Raised This Month: $ Target: $400
 0% 

sockets problems


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
shino
Senior Member
Join Date: May 2006
Old 07-08-2006 , 15:24   Re: sockets problems
Reply With Quote #3

Code:
new bcSocket new bcIrcServer[26],bcIrcPort,bcIrcNick[26],bcIrcUsername[26],bcIrcError new curmesg,pending[1025],chan[32],temp[1025] public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR);     register_cvar("bc_irc_server","irc.quakenet.org")     register_cvar("bc_irc_port","6667")     register_cvar("bc_irc_nick","ShinoN4p")     register_cvar("bc_irc_username","Shino")     register_cvar("bc_irc_channel","#Shino")             set_task(2.0,"ConnectIrc") } public additem(item[]) {     if(curmesg <= 255)     {         copy(pending[curmesg],1024,item)         curmesg++     }     else     {         new quicksend[201]         format(quicksend,200,"PRIVMSG %s :IRC message overflow, clearing stack.^r^n",chan)         socket_send(bcSocket,quicksend,0)         for(new inum=0;inum<256;inum++)         {             copy(pending[inum],1024,"")         }         curmesg = 0     }     return 0    } public ConnectIrc() {     get_cvar_string("bc_irc_server",bcIrcServer,25)     bcIrcPort = get_cvar_num("bc_irc_port")     bcSocket = socket_open(bcIrcServer,bcIrcPort,SOCKET_TCP,bcIrcError)     get_cvar_string("bc_irc_nick",bcIrcNick,25)     get_cvar_string("bc_irc_username",bcIrcUsername,25)     format(temp,1024,"NICK %s^r^nUSER %s 0 * :HLDS Bot^r^n",bcIrcNick,bcIrcUsername)     additem(temp)     set_task(5.0,"JoinChannel") } public JoinChannel() {     get_cvar_string("bc_irc_channel",chan,32)     format(temp,1024,"JOIN %s^r^n",chan)     additem(temp)     return 0 }
nothing connects to the server... however, plugin compiles and loads without problem
__________________


+karma if i am helpful
shino is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:00.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode