@hero: the dev team is focused on FreeKE (see wiki). I am currently dealing with FB and the pointers.
@anonymous: FB is FreeBASIC. Much like of Visual Basic plus pointer (and I hate it :D)
I tried to look at the tutorial of Lucky last night. I've been having problem with the pop-up dialog asking for IP/pc_name. Right now I'm googling for a work-around.
creek23
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The FB project developers discussed that ByVal in not technically the same with pointers. I really didn't get the explanation really well. -- I really thought it was the same.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
We thought of simplifying things for users. See sample below.
//provided there is already a connectionfunction mygame_onReceiveData() { Var:String sender,data;Var:Number code; Var:Boolean got_data;Net:GetData(sender,data,got_data) if (got_data EQ true) { //react on the data received based on the codeif (code EQ 1) { //the sender chooses a character if (data EQ "ck") {
`````````//sender chooses Creek} else if (data EQ "dk") { //sender chooses Dork
```````}
`````} else if (code EQ 2) { //the sender chooses a map
```````if (data EQ "ph") {//sender chooses Philippines } else if (data EQ "us") {
`````````//sender chooses America} } else { //handles unknown data
```````Konsol:Log(sender + " is sending unknown data: " + data)} ``}}
This makes parsing easier on users part.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
who wants KS engine to have a network capability thru DXPlay? suggestion on class-name...
Thanks. Will check from time to time.
how about as simple as Net? then the sample below should make a simple KS app to connect and send "hello".
Var:Number netTest;
Net:New(netTest)
Net:Connect("192.168.1.5", netTest) or Net:Connect("pc_name", netTest)
Net:Send("hello", netTest)
Net:Close()
Net sounds good.
We're planning to use WinSocket instead.
~~creek23
i thought you guys are using fb?
~[hero]~
winsocket can do. whats fb?
@hero: the dev team is focused on FreeKE (see wiki). I am currently dealing with FB and the pointers.
@anonymous: FB is FreeBASIC. Much like of Visual Basic plus pointer (and I hate it :D)
I tried to look at the tutorial of Lucky last night. I've been having problem with the pop-up dialog asking for IP/pc_name. Right now I'm googling for a work-around.
creek23
pointers in BASIC? really?
i've seen some forum discussing same problem. try http://www.vbforums.com/archive/index.php/t-117327.html
podgod
ps: now i'm not anonymous ^_^
how stupid can i get? i just realized that VB uses ByVal.
podgod
Yes but, FB uses pointers extensively as C/C++. That makes you not stupid. :D
Oh. Hey podgod, sorry about the anonymous thing. :D
How about making an SF account?
BTW, thanks for the link. The dev team will have a look. A Net class could be born soon (hopefully). :P
welcome. let me know if the Net class is ready. ill be making a simple chat demo.
podgod
The FB project developers discussed that ByVal in not technically the same with pointers. I really didn't get the explanation really well. -- I really thought it was the same.
don't you mean ByRef?
btw, the FB peeps say, that referrence is not the same with pointers. well they are the ASM guys, so they should know. :|
Oh! right, it's ByRef
I don't think ASM uses ByVal and ByRef.
enough about that. here's the tech specification:
Team Plan
Net:New(netHandler)
- allocates a Net buffer
Net:Host("session_name",max_member,netHandler)
- user acts as server
Net:Join("session_name","host_name",netHandler)
- joins a host
Net:Kick("pc_name",netHandler)
- remove client from session
- for server use only
Net:Ban("pc_name","msg",netHandler) ?
- prohibit client from joining
Net:Send("msg",netHandler)
- sends text to all members
Net:SendTo("msg","pc_name",netHandler)
- sends text to one/selected member(s)
Proposal II
Net:New(netHandler)
- allocates a Net buffer
Net:Host("session_name",max_member,b_success)
- user acts as server
Net:Join("session_name","host_name",b_success)
- joins a host
Net:Kick("pc_name",b_success)
- remove client from session
- for server use only
Net:Ban("pc_name","msg",b_success) ?
- prohibit client from joining
Net:Send("msg",b_success)
- sends text to all members
Net:SendTo("msg","pc_name",b_success)
- sends text to one/selected member(s)
NOTE that b_success will be use for command execution success status (phew).
There will be no need to make a Net buffer.
Comments anyone?
sounds good to me. can't wait to try it out.
revision on
now, it's
also added network-event listener:
{session_name}_onClientQuit
for join:
if {session_name}_onReceive is only for users who "join"-ed, what about the host?
podgod
good to hear that Net class is in progress. what about DBase?
~[hero]~
Oh, sorry about that. {session_name}_onReceive is also for the host. :D
BTW, I added GetData, and GetMessage. Also {session_name}_onReceiveData. Check the CVS.
whats the difference of GetMessage and and GetData? any day can also be sent as message. you just have to a parse the message to get the data.
podgod
We thought of simplifying things for users. See sample below.
//provided there is already a connection
function mygame_onReceiveData() {Var:String sender,data;
Var:Number code;Var:Boolean got_data;
Net:GetData(sender,data,got_data)if (got_data EQ true) {
//react on the data received based on the code
if (code EQ 1) { //the sender chooses a characterif (data EQ "ck") { `````````//sender chooses Creek
} else if (data EQ "dk") {//sender chooses Dork ```````} `````} else if (code EQ 2) { //the sender chooses a map ```````if (data EQ "ph") {
//sender chooses Philippines} else if (data EQ "us") { `````````//sender chooses America
}} else { //handles unknown data ```````Konsol:Log(sender + " is sending unknown data: " + data)
}``}
}This makes parsing easier on users part.
The KonsolScript language-design mantra is "Simplify when possible".
what is Net:New for?
~[hero]~