[PLUGIN] Sync-function

Post your completed addons to share with the community

Post » Fri Dec 09, 2011 8:52 am

Sync-function

Although chat plugin can send/receive a string to a server, you still need to make a composer/parser to assemble/disassemble the data string.
The sync-function plugin allows you to pass a command to server just like using the function plugin.

First, you should install function plugin and chat plugin.

Here is an example, you can compare it with the example in chat plugin.


The interface of sync-function plugin is similar with function plugin. You set some parameters, then call a function or execute a command string just like in function plugin.
The sync-function plugin will compose these information and send to server. When sync-function received these information from server, it will parse these and pass to the function plugin.

Note that there is a property named "Sync-mode", if "Sync-mode" set to "Stand-alone", sync-function will pass parameters to function plugin directly without sending to network. So that it is possible to create multi/single player(s) game using the same events.rexrainbow2012-05-17 11:21:15
B
97
S
22
G
178
Posts: 4,118
Reputation: 104,043

Post » Fri Dec 09, 2011 2:42 pm

wow...it's PLUGINS BUILDER your main job Rex ? ^^
B
159
S
38
G
11
Posts: 229
Reputation: 17,361

Post » Sat Dec 10, 2011 12:03 am

Making plugin is interesting.
B
97
S
22
G
178
Posts: 4,118
Reputation: 104,043

Post » Sat Dec 10, 2011 12:11 am

good job...keep doing...i'm ur best follower :D ^^
B
159
S
38
G
11
Posts: 229
Reputation: 17,361

Post » Sat Dec 10, 2011 3:41 am

I separate network to two parts.
1. connection
2. send/received

Most of events are used in send/received. Connection is only used at the start.
I split sync-function plugin from chat plugin because maybe someday I make another network plugin, user just need to replace the Chat plugin to the new one without changing the send/received logic part.
B
97
S
22
G
178
Posts: 4,118
Reputation: 104,043

Post » Sat Dec 10, 2011 8:54 am

little step to multiplayer :)
B
93
S
19
G
34
Posts: 1,840
Reputation: 27,963

Post » Mon Dec 12, 2011 2:17 pm

The .bat file has to be running for it to work right?

So how would i put this on a server to let it run?
B
29
S
12
G
7
Posts: 740
Reputation: 7,849

Post » Mon Dec 12, 2011 2:19 pm

Ah, .bat is to create a server, correctly.
Chat and sync-function is client side program, just put these into capx like other plugins.
B
97
S
22
G
178
Posts: 4,118
Reputation: 104,043

Post » Mon Dec 12, 2011 2:27 pm

So if i published the example.. sent someone the link.. then we could talk?
B
29
S
12
G
7
Posts: 740
Reputation: 7,849

Post » Mon Dec 12, 2011 2:35 pm

1. you need to create a server and be sure it can be connected, some ip address can not be connected.

2. "action: connect" in Chat plugin should set to the ip address of server.

Then you can use the example to talk.
B
97
S
22
G
178
Posts: 4,118
Reputation: 104,043

Next

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 3 guests