[Src]->Friends List.

Codes submitted by developers and people of outpost. Come here to get codes for your client sources.
Post Reply
Drajwer
<3 bd long time
Posts: 841
Joined: Fri Dec 10, 2004 3:24 pm

Post by Drajwer »

Warlord wrote: Btw maybe someone could help me. I have studied only C programming language, but c++ is much different than c.

mkay - lets go to the point.

Can anyone help me a little bit..
I think that this code is just fucked up, and my brain doesn't take it anymore..So I ask help...

Code: Select all

void CGame::LoadFriendList() //some polish friends helped me.
{
  char buf[1024];
  int konieclinii;
  unsigned long linie=0;
  FILE* f=fopen("contents\\FriendList.txt","rt");
  m_iTotalFriends=0;
  while(fgets(buf,1024,f)){
    konieclinii=0;
    int i=strlen(buf);
    if(i>0 && buf[--i]=='\n'){
      buf[i]=0; // kasujemy znak konca linii
      konieclinii=1;
      linie++;
    }
 &nbsp; if &#40;linie-1<13&#41; &#123;
 &nbsp; strcpy&#40;m_cFriends&#91;linie-1&#93;,buf&#41;;
 &nbsp; m_iTotalFriends++;
 &nbsp; &#125;
 &nbsp;&#125;
if &#40;m_iTotalFriends>12&#41; m_iTotalFriends=12;
 &nbsp;fclose&#40;f&#41;;
I already solved my problem
and... whats the question?
<img src='http://img440.imageshack.us/img440/2627/15pt.jpg' border='0' alt='user posted image' /><br><br>HBPolska characters:<br><br>Hellios 150+ Aresden Hero Mage<br>TheBill 120 Aresden plrider<br>Kill_Me 100 Full-Hero plrider<br>Rockeater 110+ Aresden Plate Mage<br><br><a href='http://www.helbreath.org' target='_blank'>http://www.helbreath.org</a> come and play (250 ppl online)
Warlord
Regular
Posts: 34
Joined: Sun Dec 05, 2004 11:08 am

Post by Warlord »

This part I got right...I had a problem with it..One symbol was missing.

But The other part, where you wrote that do some homework.

Can you give me a hint? Where should I start or smth... :o
marleythe9
Loyal fan
Posts: 391
Joined: Sat Mar 26, 2005 12:41 am

Post by marleythe9 »

ok, i had the same problem with the no show buttons, but what i did was remove the

Code: Select all

if &#40;m_iFriendIndex != -1&#41; &#123;
int he DrawDialogBox_FriendList function

also make sure you remove a ending } before break;, but it seamed to work for me :)..

but sadly there is a ting you forgot to add int he code, u know u dont even call for the "LoadFriendList()" function.... so basicly in your code the friends list isnt loading...
but i added that too under the ctrl+f area

Code: Select all

case 70&#58; //'F'
 if &#40;m_bCtrlPressed == TRUE && m_cGameMode == DEF_GAMEMODE_ONMAINGAME && &#40;!m_bInputStatus&#41; &#41;
	LoadFriendList&#40;&#41;;
 EnableDialogBox&#40;43, NULL, NULL, NULL&#41;;
 break;
......sadely client crashes when it loads too :(...(*nvm i guess it worked i just tryed it lol)
(WOOHOO!, lol nvm its all working saves my char name too :))

oh and a good idea for the friends list is ;) saveing the list by char name, i have it setup for that, becouse alot people use more then one account / character / more one person play the computer.

... i also dont think its a good idea to add there friends list ont he server side, becouse thats just more messages, and more bandwidth, its best to keep stuff like this on client side.

Code: Select all

void CGame&#58;&#58;LoadFriendList&#40;&#41; //some polish friends helped me.
&#123;
 char buf&#91;1024&#93;;
 int konieclinii;
 unsigned long linie=0;
 //new load by char name
	char cFn&#91;256&#93;/*, cTemp&#91;255&#93;*/;
wsprintf&#40;cFn,"contents&#092;&#092;friends&#092;&#092;%s.txt", m_cPlayerName&#41;;
FILE* f=fopen&#40;cFn,"rt"&#41;;
 m_iTotalFriends=0;
if&#40;f == NULL&#41; &#123;
FILE* c=fopen&#40;cFn, "w"&#41;;
fclose&#40;c&#41;;
&#125;
 while&#40;fgets&#40;buf,1024,f&#41;&#41;&#123;
 &nbsp; konieclinii=0;
 &nbsp; int i=strlen&#40;buf&#41;;
 &nbsp; if&#40;i>0 && buf&#91;--i&#93;=='&#092;n'&#41;&#123;
 &nbsp; &nbsp; buf&#91;i&#93;=0; // kasujemy znak konca linii
 &nbsp; &nbsp; konieclinii=1;
 &nbsp; &nbsp; linie++;
 &nbsp; &#125;
if &#40;linie-1<13&#41; &#123;
strcpy&#40;m_cFriends&#91;linie-1&#93;,buf&#41;;
m_iTotalFriends++;
&#125;
 &#125;
if &#40;m_iTotalFriends>12&#41; m_iTotalFriends=12;
 fclose&#40;f&#41;;
&#125;
void CGame&#58;&#58;SaveFriendList&#40;&#41;
&#123;
	char cFn&#91;256&#93;/*, cTemp&#91;255&#93;*/;
wsprintf&#40;cFn,"contents&#092;&#092;friends&#092;&#092;%s.txt", m_cPlayerName&#41;;
FILE* f=fopen&#40;cFn,"w"&#41;;
int i;
char wr&#91;12&#93;;
for &#40;i=0;i<m_iTotalFriends;i++&#41; &#123;
ZeroMemory&#40;wr,sizeof&#40;wr&#41;&#41;;
wsprintf&#40;wr,"%s&#092;n",m_cFriends&#91;i&#93;&#41;;
fputs&#40;wr,f&#41;;
&#125;
fclose&#40;f&#41;;
&#125;
also i made it save on log off to.
i think thats why it was crashing ;), it didnt save lol. becouse m_cPlayerName isnt identifyed when your closeing the game lol...

you can juse search

Code: Select all

if&#40; m_cLogOutCount == -1 &#41;
then add this after PlaySound('E', 14, 5); witch is a few lines down.

Code: Select all

 &nbsp;memcpy&#40;m_cFriends&#91;m_iTotalFriends&#93;,m_cMCName,10&#41;;
 &nbsp;m_iTotalFriends++;
 &nbsp;m_stDialogBoxInfo&#91;43&#93;.sV1=0;
 &nbsp;SaveFriendList&#40;&#41;;
works for me now :)...
good idea Drajwer :)... i may try to also add a thing were u can typ there name in..
instead of happen to click them.
<img src='http://freewebs.com/trickro/70s.png' border='0' alt='user posted image' /><img src='http://freewebs.com/trickro/70s2.jpg' border='0' alt='user posted image' />
ogeid
Member
Posts: 110
Joined: Thu Feb 02, 2006 11:11 pm

Post by ogeid »

:lol: wow thanks! marleythe9! now box show me "add" "delete" and "whisper" but i cant add ppl :( and i cant close dialogbox whit right click too :(

help

oh no i do all again and now game crashed! :(


help plz
"Prefiero morir de pie que vivir arrodillado"
marleythe9
Loyal fan
Posts: 391
Joined: Sat Mar 26, 2005 12:41 am

Post by marleythe9 »

search

Code: Select all

m_stDialogBoxInfo&#91;42&#93;.sSizeY = 339;
add this under it

Code: Select all

 &nbsp;// friends
	m_stDialogBoxInfo&#91;43&#93;.sX = 0;
	m_stDialogBoxInfo&#91;43&#93;.sY = 0;
	m_stDialogBoxInfo&#91;43&#93;.sSizeX = 258;
	m_stDialogBoxInfo&#91;43&#93;.sSizeY = 339;
and if u dont have this already search:

Code: Select all

// levelup diag
add this under the break after that case

Code: Select all

//friends list
case 43&#58;
	if &#40;m_bIsDialogEnabled&#91;43&#93; == FALSE&#41;
	&#123;
 m_iFriendIndex = -1;
 m_stDialogBoxInfo&#91;43&#93;.sV1= 0;
	&#125;
 break;
oh ya and you do need this soo search:

Code: Select all

// Snoopy&#58; Drag Gail menu
add this after that case:

Code: Select all

	case 43&#58; // Drajwer - friendlist s
 &nbsp; &nbsp;m_stMCursor.cSelectedObjectType = DEF_SELECTEDOBJTYPE_DLGBOX;
 &nbsp; &nbsp;m_stMCursor.sSelectedObjectID &nbsp; = cDlgID;
 &nbsp; &nbsp;break;
this code is on what drajwer posted heh but this is main code for why the dialog box isnt movable and all that ;). but the other code u need, or ull probley get errors.

oh and by the way on the above post heh, the case 70 for the f, if function isnt correct, soo basicly with that one it will come up with the letter f pressed, so u may wana add {'s or something ;)
<img src='http://freewebs.com/trickro/70s.png' border='0' alt='user posted image' /><img src='http://freewebs.com/trickro/70s2.jpg' border='0' alt='user posted image' />
Drajwer
&lt;3 bd long time
Posts: 841
Joined: Fri Dec 10, 2004 3:24 pm

Post by Drajwer »

Also, the list should be scrollable and there should be no friend limit... any Binary Lists will be ok. I dont have time atm so do what you want and post updates here :)
<img src='http://img440.imageshack.us/img440/2627/15pt.jpg' border='0' alt='user posted image' /><br><br>HBPolska characters:<br><br>Hellios 150+ Aresden Hero Mage<br>TheBill 120 Aresden plrider<br>Kill_Me 100 Full-Hero plrider<br>Rockeater 110+ Aresden Plate Mage<br><br><a href='http://www.helbreath.org' target='_blank'>http://www.helbreath.org</a> come and play (250 ppl online)
marleythe9
Loyal fan
Posts: 391
Joined: Sat Mar 26, 2005 12:41 am

Post by marleythe9 »

alright, ya should have scrolling ;), hey Drajwer on mine i have to have like a Enter on the top of the file or my client crashes, and on the game, i have like wierd name or what ever on the top of the dialog, if i delete it, it will crash my client ;(... have any idea???
<img src='http://freewebs.com/trickro/70s.png' border='0' alt='user posted image' /><img src='http://freewebs.com/trickro/70s2.jpg' border='0' alt='user posted image' />
ogeid
Member
Posts: 110
Joined: Thu Feb 02, 2006 11:11 pm

Post by ogeid »

ImageALELUHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! :blink:


WORKSSSSSSSSS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!



"Prefiero morir de pie que vivir arrodillado"
Drajwer
&lt;3 bd long time
Posts: 841
Joined: Fri Dec 10, 2004 3:24 pm

Post by Drajwer »

sux skin
<img src='http://img440.imageshack.us/img440/2627/15pt.jpg' border='0' alt='user posted image' /><br><br>HBPolska characters:<br><br>Hellios 150+ Aresden Hero Mage<br>TheBill 120 Aresden plrider<br>Kill_Me 100 Full-Hero plrider<br>Rockeater 110+ Aresden Plate Mage<br><br><a href='http://www.helbreath.org' target='_blank'>http://www.helbreath.org</a> come and play (250 ppl online)
ogeid
Member
Posts: 110
Joined: Thu Feb 02, 2006 11:11 pm

Post by ogeid »

Image


now? :unsure:

i love u drajwer and marleythe9!
"Prefiero morir de pie que vivir arrodillado"
ADDKiD
&lt;3 bd long time
Posts: 967
Joined: Tue Jul 12, 2005 8:07 pm
Location: Washington, USA
Contact:

Post by ADDKiD »

Ok, Well why doesn't someone comiple it so people can test it? I'd like to test it myself... Is there anyway I can integrate Angels into v3.51? along with Friends list and possibly some other stuff. I want to pay someone to code this for me... I think all servers should join together and own Sango's server...
ogeid
Member
Posts: 110
Joined: Thu Feb 02, 2006 11:11 pm

Post by ogeid »

ADDKiD wrote: Ok, Well why doesn't someone comiple it so people can test it? I'd like to test it myself... Is there anyway I can integrate Angels into v3.51? along with Friends list and possibly some other stuff. I want to pay someone to code this for me... I think all servers should join together and own Sango's server...
ya.... i am whit u
"Prefiero morir de pie que vivir arrodillado"
Tafka12
&lt;3 bd long time
Posts: 772
Joined: Wed Dec 28, 2005 6:32 pm

Post by Tafka12 »

All servers join together
20servers become 1 big server?

A joke??
<img src='http://www.hot.ee/carvanho/taavi.png' border='0' alt='user posted image' /><br><br><img src='http://www.hot.ee/carvanho/Elvine.png' border='0' alt='user posted image' /><br><img src='http://www.hot.ee/carvanho/LieroX.png' border='0' alt='user posted image' /><br><img src='http://www.hot.ee/carvanho/Football.png' border='0' alt='user posted image' />
sokol
Loyal fan
Posts: 228
Joined: Mon May 02, 2005 7:28 pm
Location: P(r)oland

Post by sokol »

its good idea but u need like 10 programers and nice dedi hoster also exp x2-3 max lvl 180 max stat 200 low drop and u got like 200ppl online
juggalo2
Spamtastic
Posts: 1144
Joined: Sun Jul 17, 2005 5:28 pm

Post by juggalo2 »

sokol wrote: its good idea but u need like 10 programers and nice dedi hoster also exp x2-3 max lvl 180 max stat 200 low drop and u got like 200ppl online
hmm thats good idear tobad not alot of ppl wnana do it im startiun g one welling ben working one it for a while now geting all hb error fixed thats already updating to 3.82 wqithout bugs. then addning new maps towns class and such. then join server to ahve 1 hugly modified and 1 like orgianl server but 3.82 without bugs will be sick setup there will be a poertal in each server to transport to the otehre server its a idear but easyly to do :P gotta do a lot of codeing well. i always wabnted to do it now i im if im by my self or not i dotn want 1000 server i wasnt 1 with 2 type reg hb and crazy hb with 1000+ all server will bow down to us and surender to us :P i wish it was tahts smiple but will see


<img src='http://lifeplaysu420.com/unknow/nightsign.png' border='0' alt='user posted image' /><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>Wanna make money for surfing the net sing up at <br><a href='http://www.cashfiesta.com/php/join.php? ... yprivitera' target='_blank'>cash fiesta</a><br>its all free hey why ntot make money while fucking around on the computer<br><br><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Post Reply