Raised This Month: $85 Target: $400
 21% 

Sockets and webservers


Post New Thread Reply   
 
Thread Tools Display Modes
DarkSnow
Senior Member
Join Date: Oct 2005
Location: 127.0.0.1
Old 11-23-2006 , 10:55   Re: Sockets and webservers
Reply With Quote #11

Quote:
Originally Posted by DotNetJunkie View Post
I have a modified version of the sockets module I wrote, for AMXX version I forget, that will allow you to listen for connections.

In fact I wrote a simple web server in PAWN but unfortunately its getting
really complicated because I need to parse cookies and other stuff like
that to do anything more advanced.
Sounds interesting. It would actualy be kinda nice to have sortof a html based shell for rcon similar tasks..

Any eta on when it will be finnished, or perhaps do you have an alpha distribution or similar?
__________________
DarkSnow is offline
Send a message via MSN to DarkSnow
The Specialist
BANNED
Join Date: Nov 2006
Old 11-23-2006 , 13:10   Re: Sockets and webservers
Reply With Quote #12

Is it possable to connect to a website , and transfer teh html format back to the plugin ? for example , I connect to "www.yahoo.com/mail" , Then retireve the html format and transfer it to motd file to display in game ? im making a email mod . Where a server can allwo players to check there email in game.
The Specialist is offline
Send a message via AIM to The Specialist
Zenith77
Veteran Member
Join Date: Aug 2005
Old 11-23-2006 , 22:42   Re: Sockets and webservers
Reply With Quote #13

You can just put the url where the text should be in show_motd()...

Code:
show_motd(id, "http://www.myweb.com", "A Website");
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
The Specialist
BANNED
Join Date: Nov 2006
Old 11-24-2006 , 00:21   Re: Sockets and webservers
Reply With Quote #14

nice , good idea , thank Zenith ++karma
The Specialist is offline
Send a message via AIM to The Specialist
Simon Logic
Senior Member
Join Date: Nov 2006
Location: RF
Old 11-30-2006 , 07:51   Re: Sockets and webservers
Reply With Quote #15

Sample example is syntactically wrong. Here is at least a compiling errors/warnings free example.

Also i have a question to DarkSnow.

Can you explain this one:
Quote:
/* This function will return true if the state (buffer content) have changed within the last recieve or the timeout, where timeout is a value in чSeconds, (1 sec =1000000 чsec). Use to check if new data is in your socket. */
I don't get how one function can return true or timeout. Or will timeout be greater than 0, and true is less then 0? Your source code does not cover/use this feature.

Also i don't understand wether socket_change() wait for timeout interval (is it a sync function?) until it gets some data or it's non sync function and you must call it in loop until it returns true or timeout interval which was passed as a second argument (_timeout)?
Attached Files
File Type: sma Get Plugin or Get Source (socket_sample.sma - 612 views - 2.0 KB)

Last edited by Simon Logic; 11-30-2006 at 13:28.
Simon Logic is offline
Send a message via Skype™ to Simon Logic
DarkSnow
Senior Member
Join Date: Oct 2005
Location: 127.0.0.1
Old 11-30-2006 , 12:59   Re: Sockets and webservers
Reply With Quote #16

Quote:
Originally Posted by Simon Logic View Post
I don't get how one function can return true or timeout. Or will timeout be greater than 0, and true is less then 0?
As far as i know, TRUE is a boolean value and its integer value is -1, so you will basicly know if the value is greater then 0 you have a timeout, otherwise its true.

Quote:
Originally Posted by Simon Logic View Post
Your source code does not cover/use this feature.
It's intended to keep things simple

Quote:
Originally Posted by Simon Logic View Post
Also i don't understand wether socket_change() wait for timeout interval (is it a sync function?) until it gets some data or it's non sync function and you must call it in loop until it returns true or timeout interval which was passed as a second argument (_timeout)?
Im not sure myself, i'd better leave it for someone of the amx mod x developement team to fill in that one
__________________
DarkSnow is offline
Send a message via MSN to DarkSnow
Simon Logic
Senior Member
Join Date: Nov 2006
Location: RF
Old 11-30-2006 , 14:48   Re: Sockets and webservers
Reply With Quote #17

Somebody point me a link to http://www.amxmodx.org/funcwiki.php?...ange&go=search
and took off a stupid karma again (how i wish it would be blocked or invisible) instead of sending a PM to me or posting here. What a funny guy. There was nothing new in comparing with comments written in socket.inc (and which i posted above). So, i'll make a test by myself later.

PS. Actually TRUE is NOT FALSE. FALSE is always 0, but TRUE may not be -1. TRUE is just non zero value =)
That is why the return value confused me.

Currently under AMX/X TRUE translates into 1, not -1.
Simon Logic is offline
Send a message via Skype™ to Simon Logic
Greenberet
AMX Mod X Beta Tester
Join Date: Apr 2004
Location: Vienna
Old 11-30-2006 , 17:52   Re: Sockets and webservers
Reply With Quote #18

Quote:
Originally Posted by Simon Logic View Post
PS. Actually TRUE is NOT FALSE. FALSE is always 0, but TRUE may not be -1. TRUE is just non zero value =)
That is why the return value confused me.

Currently under AMX/X TRUE translates into 1, not -1.
yes/no
anything that is not null is true, and null is false.
BUT!! When you convert true to an integer it will be 1. Thats an programming standard. So this conversion has nothing to do with amxx^^
Greenberet is offline
Send a message via ICQ to Greenberet Send a message via MSN to Greenberet
Simon Logic
Senior Member
Join Date: Nov 2006
Location: RF
Old 12-01-2006 , 11:43   Re: Sockets and webservers
Reply With Quote #19

Quote:
Originally Posted by Greenberet View Post
yes/no
anything that is not null is true, and null is false.
I was taught in the university that NULL is INVALID (unset) DATA, which has no relation to the boolean algebra. However, nothing blocks you to assume that FALSE is NULL, but not one algorithmic language (i've ever seen) uses this collation because of above statement.
Simon Logic is offline
Send a message via Skype™ to Simon Logic
Greenberet
AMX Mod X Beta Tester
Join Date: Apr 2004
Location: Vienna
Old 12-01-2006 , 12:09   Re: Sockets and webservers
Reply With Quote #20

only in P/SQL
Greenberet is offline
Send a message via ICQ to Greenberet Send a message via MSN to Greenberet
Reply


Thread Tools
Display Modes

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 09:20.


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