[REQ] "Notes" Code

All Helbreath Client Source Discussion here.
locobans
Outpost Junkie
Posts: 2264
Joined: Tue Jul 13, 2004 3:51 am
Location: Behind You
Contact:

Post by locobans »

Dominican Republic :)
QUOTE (ADDKiD @ Dec 1 2006, 4:01 PM) <br>You guys make me laugh alot, half the shit I say, is bullshit...<br><br><img src='http://img485.imageshack.us/img485/492/banssig1ng.gif' border='0' alt='user posted image' /><br><br><b>I see no changes at all, wake up in the morning and ask myself...<br>Is life worth living? Should I blast myself?</b><br><br><b><a href='http://2paclegacy.com' target='_blank'>2PacLegacy.com</a></b>
Shetar
Member
Posts: 148
Joined: Sun Nov 30, 2003 12:57 am

Post by Shetar »

XD whahahaha
Helbreath II Project Manager & All round Developer. <br><i>(Don't worry, we're not dead)</i>
ADDKiD
&lt;3 bd long time
Posts: 967
Joined: Tue Jul 12, 2005 8:07 pm
Location: Washington, USA
Contact:

Post by ADDKiD »

locobans wrote: Dominican Republic :)
I wub you Loco! :wub:
maxichalba
noob
Posts: 27
Joined: Sun Aug 27, 2006 4:50 am

Post by maxichalba »

orkl u slept xD can some1 make the code?
zeroeoypnk
noob
Posts: 11
Joined: Thu Aug 17, 2006 5:34 am

Post by zeroeoypnk »

Since power it he can, is not very difficult, I it am working, for the present I cannot postear anything as that it he has muchisimos mistakes, but you upset it he finishes it I spend pass it to you ;)


Cya!
<b><i>ZeroEoyPnk</i></b><br><img src='http://ar.geocities.com/eoy_zero/mas_para_mi.jpg' border='0' alt='user posted image' />
Dax
&lt;3 bd long time
Posts: 785
Joined: Mon Apr 18, 2005 3:19 pm

Post by Dax »

zeroeoypnk wrote: Since power it he can, is not very difficult, I it am working, for the present I cannot postear anything as that it he has muchisimos mistakes, but you upset it he finishes it I spend pass it to you ;)


Cya!
Translation:

Since power it he can, is not very difficult
Since a rat can eat a power cord, it must not be very difficult.

I it am working
I am working on eating 1 right now

for the present I cannot postear anything as that it he has muchisimos mistakes
without a christmas present i can't post anything without many mistakes.

but you upset it he finishes it I spend pass it to you ;)
If my rat is not upset, he can eat 4 whole power cords in 1 day ;)



Well thats what googles Retard->English translation spat out.. I hope it helps more then his original post did.
Reppin' 127.0.0.1!!!<br><br><img src='http://img502.imageshack.us/img502/1348/sig4daxbn2.jpg' border='0' alt='user posted image' /><br><br>I contend that we are both atheists. I just believe in one fewer god than you do. <br>When you understand why you dismiss all the other possible gods, you will <br>understand why I dismiss yours.<br>~ <b>Stephen Roberts</b>
ADDKiD
&lt;3 bd long time
Posts: 967
Joined: Tue Jul 12, 2005 8:07 pm
Location: Washington, USA
Contact:

Post by ADDKiD »

Lol, your so nice Dax...
XsX
Regular
Posts: 32
Joined: Sat May 15, 2004 8:53 pm

Post by XsX »

sos bobo dax
ogeid
Member
Posts: 110
Joined: Thu Feb 02, 2006 11:11 pm

Post by ogeid »

ADDKiD wrote: Lol, your so nice Dax...
:o sex unknown = detected
"Prefiero morir de pie que vivir arrodillado"
bone-you
Spamtastic
Posts: 1310
Joined: Wed Mar 16, 2005 3:12 am

Post by bone-you »

I'd have made it GUI but with no interface.. can't do it :P so here is a command version.




Notes command (NOTE this is untested and may/may not work.)

Client.h into the class

Code: Select all

	struct {
  char m_cNotes[90];
	} m_stNotesList[20];
Client.cpp into the initialization.

Code: Select all

	for (i = 0; i < 20; i++)
  ZeroMemory(m_stNotesList[i].m_cNotes, 90);

Game.h into the class

Code: Select all

	void ViewNotes(int iClientH);
	void AddNote(int iClientH, char * pData, DWORD dwMsgSize);
	void DeleteNote(int iClientH, char * pData, DWORD dwMsgSize);
Game.cpp all over the place

ChatMsgHandler

Code: Select all

  if (memcmp(cp, "/notes", 6) == 0) {
  	ViewNotes(iClientH);
  	return;
  }
  if (memcmp(cp, "/addnote", 8) == 0) {
  	AddNote(iClientH, cp, dwMsgSize - 21);
  	return;
  }
  if (memcmp(cp, "/delnote", 8) == 0) {
  	DeleteNote(iClientH, cp, dwMsgSize - 21);
  	return;
  }
Anywhere

Code: Select all

void CGame::ViewNotes(int iClientH)
{
	char   seps[] = "= \t\n";
	char   * cp, * token, cBuff[256];
	register int i;

	if (m_pClientList[iClientH] == NULL) return;

	ZeroMemory(cBuff, sizeof(cBuff));
	for (i = 0; i < 20; i++)
	{
  if (strlen(m_pClientList[iClientH]->m_stNotesList[i].m_cNotes) > 0)
  {
  	wsprintf(cBuff, "Note%d: %s", i, m_pClientList[iClientH]->m_stNotesList[i].m_cNotes);
  	ShowClientMsg(iClientH, cBuff);
  }
	}
}



void CGame::AddNote(int iClientH, char *pData, DWORD dwMsgSize)
{
	char   seps[] = "= \t\n";
	char   * cp, * token, cBuff[256];
	class  CStrTok * pStrTok;
	register int i;

	if (m_pClientList[iClientH] == NULL) return;
	if ((dwMsgSize)	<= 0) return;

	ZeroMemory(cBuff, sizeof(cBuff));
	memcpy(cBuff, pData, dwMsgSize);

	pStrTok = new class CStrTok(cBuff, seps);
	token = pStrTok->pGet();
	token = pStrTok->pGet();

	if (token != NULL)
	{
  for (i = 0; i < 20; i++)
  {
  	if (strlen(m_pClientList[iClientH]->m_stNotesList[i].m_cNotes) == 0)
  	{
    memcpy(m_pClientList[iClientH]->m_stNotesList[i].m_cNotes, token, strlen(token));
    wsprintf(cBuff, "Note %d added.", i);
    ShowClientMsg(iClientH, cBuff);
    delete pStrTok;
    return;
  	}
  }
  ShowClientMsg(iClientH, "Too many notes added.");
  delete pStrTok;
  return;
	}

	delete pStrTok;
}

void CGame::DeleteNote(int iClientH, char *pData, DWORD dwMsgSize)
{
	char   seps[] = "= \t\n";
	char   * cp, * token, cBuff[256];
	class  CStrTok * pStrTok;
	register int i;

	if (m_pClientList[iClientH] == NULL) return;
	if ((dwMsgSize)	<= 0) return;

	ZeroMemory(cBuff, sizeof(cBuff));
	memcpy(cBuff, pData, dwMsgSize);

	pStrTok = new class CStrTok(cBuff, seps);
	token = pStrTok->pGet();
	token = pStrTok->pGet();

	if (token != NULL)
	{
  i = atoi(token);

  if (i > 20)
  {
  	ShowClientMsg(iClientH, "Value too high!");
  	delete pStrTok;
  	return;
  }
  if (strlen(m_pClientList[iClientH]->m_stNotesList[i].m_cNotes) != 0)
  {
  	ZeroMemory(m_pClientList[iClientH]->m_stNotesList[i].m_cNotes, 90);
  	wsprintf(cBuff, "Note %d deleted.", i);
  	ShowClientMsg(iClientH, cBuff);
  	break;
  }
	}

	delete pStrTok;
}

_bDecodePlayerDatafileContents
at the head

Code: Select all

int iNotesIndex = 0;

Code: Select all

  	case 84:
    //Notes list
    if (iNotesIndex > 50) {
    	wsprintf(cTxt, "(!!!) Player(%s) data file error! Too many notes - Connection closed. ", m_pClientList[iClientH]->m_cCharName); 
    	PutLogList(cTxt);
    	delete pContents;
    	delete pStrTok;
    	return FALSE;
    }
    memcpy(m_pClientList[iClientH]->m_stNotesList[iNotesIndex].m_cNotes, token, strlen(token));
    iNotesIndex++;
    cReadModeA = 0;
    break;

Code: Select all

  	if (memcmp(token, "character-notes", 15) == 0)    cReadModeA = 84;//Notes
_iComposePlayerDatafileContents

Code: Select all

	strcat(pData, "[NOTES]\n\n");

	for (i = 0; i < 20; i++)
	{
  if (m_pClientList[iClientH]->m_stNotesList[i].m_cNotes[0] != NULL)
  {
  	strcat(pData, "character-notes = ");
  	strcat(pData, m_pClientList[iClientH]->m_stNotesList[i].m_cNotes);
  	strcat(pData, "\n");
  }
	}
	strcat(pData, "\n\n");
<img src='http://www.helbreathx.net/sig/sig.jpeg' border='0' alt='user posted image' /><br><a href='http://mafia.cheats4us.org/index.php?x=231030' target='_blank'>#1 on Mafia :D</a><br><!--QuoteBegin-Slipknight+--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Slipknight)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->100mb Internet, burstable too 10GB oc192<br>his speed can go up too 10gbs<br>...<br>Yes my car can have a top speed of 1000mph<!--QuoteEnd--></td></tr></table><div class='signature'><!--QuoteEEnd--><br>^^ I wonder where the retard went to.
ADDKiD
&lt;3 bd long time
Posts: 967
Joined: Tue Jul 12, 2005 8:07 pm
Location: Washington, USA
Contact:

Post by ADDKiD »

ogeid wrote:
ADDKiD wrote: Lol, your so nice Dax...
:o sex unknown = detected
I'm a guy, fucktard. Good Job Zero, I figured you'd put something out soon. Always count on you to help others...
marleythe9
Loyal fan
Posts: 391
Joined: Sat Mar 26, 2005 12:41 am

Post by marleythe9 »

tell someone makes the code why not just comunicate threw Player info change your player info heh.
<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' />
juggalo2
Spamtastic
Posts: 1144
Joined: Sun Jul 17, 2005 5:28 pm

Post by juggalo2 »

nice zero keep it up
<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>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ADDKiD
&lt;3 bd long time
Posts: 967
Joined: Tue Jul 12, 2005 8:07 pm
Location: Washington, USA
Contact:

Post by ADDKiD »

Has anyone gotten this to work? J/w...
Jensen
Loyal fan
Posts: 300
Joined: Tue Aug 02, 2005 7:40 am
Location: Illinois, USA
Contact:

Post by Jensen »

Well aside from the fact that someone already posted it, I'm not going to see if it works. I don't think people should be sharing accounts, thats where some of their problems come from.

ADDKiD, your still a fuckwit, don't try and flame a kid when you are near incompetent yourself, you couldn't code your way out of a paper bag. Stick with designing and not talking to people about something you didn't think up. That reply button doesn't need to be hit all the time.

And I didn't know Google had a retard translator, I've been reading those guys wrong the whole time.

bone-you, gj on actually putting in some work hope it works great for those that need something like that.
-><-
Post Reply