Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (VoroneTZ), 1,244 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 3 1 2 3
A6Network - Final Beta #135852
06/11/07 21:10
06/11/07 21:10
Joined: Jan 2006
Posts: 1,829
Neustadt, Germany
T
TWO Offline OP

Serious User
TWO  Offline OP

Serious User
T

Joined: Jan 2006
Posts: 1,829
Neustadt, Germany
Here is the beta version of the A6Network plugin. It replaces all internal mp functions and adds new capabilities to the engine.

The beta has no locked features, you only get a message box while creating a server instance. I won't tell you how wonderful the world is, so just click the download link and while downloading take a look at the feature list

http://worldawake.eu.tc/public/A6Network_Beta.rar

A basic function description and a demo app are included. _Please give me ALOT of feedback, no matter if it's good or bad_.

NOTE: This release is only for LITE-C.

Feature list:

- Basic and advanced sending functions
- Great event system
- Secure connections
- Network simulator ( simulating bad connections )
- LAN server list
- Advanced player managerment functions such as ban and kick
- Client File check
- VOIP
- Trackers (track state of var/string/entity and send to client/server is changed, with scalable delay between sending)

Code:


// ***************************************************************
// Copyright (C) 2006/2007 Bloodline except otherwise marked.
// All Rights reserved.
// -------------------------------------------------------------
// file: A6Network | date: 2/2/2007
// -------------------------------------------------------------
// purpose: A6Network Plugin Version 0.9 b
// ***************************************************************

#ifndef _A6Network_h_
#define _A6Network_h_

typedef struct
{
char* IP;
int Port;
} Net_SystemAddress;

//////////////////////////////////////////////////////////////////////////
// Client functions

// Core
void Net_ClCreate();
BOOL Net_ClStartup(char* _DefaultEntity);
BOOL Net_ClConnect( Net_SystemAddress* Address, char* Password );
void Net_ClDisconnect();
void Net_ClDestroy();
BOOL Net_ClIsConnected();

// Network Simulator
void Net_ClApplyNetworkSimulator(int maxSendBPS, int minExtraPing, int extraPingVariance);

// Security
void Net_ClInitializeSecurity();
void Net_ClDisableSecurity();

// Sending functions
void Net_ClSendVar( char* VarName, int Reliability, int Priority, BOOL Broadcast );
void Net_ClSendArray( char* ArrayName, int length, int Reliability, int Priority, BOOL Broadcast );
void Net_ClSendString( char* StringName, int Reliability, int Priority, BOOL Broadcast );
void Net_ClSendEntity( ENTITY* SourceEntity, int WhatToSend, int Reliability, int Priority, BOOL Broadcast );
void Net_ClRegisterEntity( ENTITY* SourceEntity );
void Net_ClSendEvent( int ID, int Reliability, int Priority, BOOL Broadcast );
void Net_ClSendChatMsg( char* StringName, char* FunctionName, int Priority );
void Net_ClSendClientInformation( char* Name );

// Events
void Net_ClEventFunctionsReset();
void Net_ClEventFunctionReset(int ID);
void Net_ClEventSetFunction(int ID, char* Name);

// File validation
void Net_ClFileVerificationAddFile(char* Name, BOOL RequiredFile);
void Net_ClFileVerificationActivate();
void Net_ClFileVerificationDeactivate();

// LAN Server search
void Net_ClLANPing(int ServerPort);
void Net_ClLANResetList();
int Net_ClLANGetServerListCount();
Net_SystemAddress* Net_ClLANGetServerFromList(int ID);

// VOIP
void Net_ClVoiceStartup();
void Net_ClVoiceMuteMircrofon();
void Net_ClVoiceUnmuteMircrofon();
void Net_ClVoiceRequestChannel();
void Net_ClVoiceRelease();

//////////////////////////////////////////////////////////////////////////
// Server functions

// Core
void Net_SvCreate();
int Net_SvStartup( int MaxPlayers, int ServerPort, char* Password, char* _DefaultEntity );
int Net_SvGetClientIDFromLastMessage();
void Net_SvWriteStatisticsToFile(char* Filename);
void Net_SvDestroy();

// Network Simulator
void Net_SvApplyNetworkSimulator(int maxSendBPS, int minExtraPing, int extraPingVariance);

// Security
void Net_SvInitializeSecurity();
void Net_SvDisableSecurity();

// MTU
void Net_SvSetMTUSize(int Size);

// Player Managerment
int Net_SvGetConnectedPlayers();
char* Net_SvClientListGetNameByID( int Index );
int Net_SvClientListGetIDByName( char* Name );
void Net_SvKickPlayerWithID( int ID );
void Net_SvKickAllPlayers();
void Net_SvBanPlayerWithID( int ID, int Time );
void Net_SvBanPlayerWithIP( char* IP, int Time );
void Net_SvRemovePlayerBanWithID( int ID );
void Net_SvRemovePlayerBanWithIP( char* IP );
char* Net_SvGetIPfromID( int ID );
void Net_SvRedirectClient(char* IP, int ServerPort, int SysAddress, BOOL Broadcast);

// Sending functions
void Net_SvSendVar( char* VarName, int Reliability, int Priority, int SysAddress, BOOL Broadcast );
void Net_SvSendArray( char* ArrayName, int length, int Reliability, int Priority, int SysAddress, BOOL Broadcast );
void Net_SvSendString( char* StringName, int Reliability, int Priority, int SysAddress, BOOL Broadcast );
void Net_SvSendEntity( ENTITY* SourceEntity, int WhatToSend, int Reliability, int Priority, int SysAddress, BOOL Broadcast );
void Net_SvRegisterEntity( ENTITY* SourceEntity );
void Net_SvSendEvent( int ID, int Reliability, int Priority, int SysAddress, BOOL Broadcast );
void Net_SvSendChatMsg( char* StringName, char* FunctionName, int SysAddress, BOOL Broadcast );
void Net_SvAddObjectToBlacklist( char* ObjectName );
BOOL Net_IsOnBlacklist( char* ObjectName );

// Events
void Net_SvEventFunctionsReset();
void Net_SvEventFunctionReset(int ID);
void Net_SvEventSetFunction(int ID, char* Name);

// Trackers
void Net_SvTrackVar(char* VarName, int Reliability, int Priority, int SysAddress, BOOL Broadcast, int SendDelay);
void Net_SvTrackArray(char* ArrayName, int Length, int Reliability, int Priority, int SysAddress, BOOL Broadcast, int SendDelay);
void Net_SvTrackString(char* StringName, int Reliability, int Priority, int SysAddress, BOOL Broadcast, int SendDelay);

// File validation
void Net_SvFileVerificationAddFile(char* Name, BOOL RequiredFile);
void Net_SvFileVerificationActivate();
void Net_SvFileVerificationDeactivate();
void Net_SvFileVerificationSetOnUnknown(char* Function);
void Net_SvFileVerificationSetOnFailed(char* Function);

// VOIP
void Net_SvVoiceStartup();
void Net_SvVoiceMuteMircrofon();
void Net_SvVoiceUnmuteMircrofon();
void Net_SvVoiceRelease();

//////////////////////////////////////////////////////////////////////////
// Packet Entity Data

#define Net_EntData_Position 1 // Data to send: Position
#define Net_EntData_Angle 2 // Data to send: Angle
#define Net_EntData_Size 4 // Data to send: Size
#define Net_EntData_Albedo 8 // Data to send: Albedo
#define Net_EntData_Alpha 16 // Data to send: Alpha
#define Net_EntData_Ambient 32 // Data to send: Ambient
#define Net_EntData_Lightrange 64 // Data to send: Lightrange
#define Net_EntData_Type 128 // Data to send: Modell file
#define Net_EntData_Skills 256 // Data to send: Skills
#define Net_EntData_CreateIfNotSet 512 // Data to send: Entity

//////////////////////////////////////////////////////////////////////////
// Packet Priority

#define Net_Priority_High 1
#define Net_Priority_Medium 2
#define Net_Priority_Low 3

//////////////////////////////////////////////////////////////////////////
// Packet Reliability

#define Net_Reliability_UNRELIABLE 1
#define Net_Reliability_UNRELIABLE_SEQUENCED 2
#define Net_Reliability_RELIABLE 3
#define Net_Reliability_RELIABLE_ORDERED 4
#define Net_Reliability_RELIABLE_SEQUENCED 5

//////////////////////////////////////////////////////////////////////////
// System Address

#define Net_UNASSIGED_ADDRESS -1

//////////////////////////////////////////////////////////////////////////
// Events

int Net_EventGetID(char* EventType); // Internal function

#define Net_Event_ConnectionRequestAcceppted Net_EventGetID("ID_CONNECTION_REQUEST_ACCEPTED");
#define Net_Event_ConnectionAttemptFailed Net_EventGetID("ID_CONNECTION_ATTEMPT_FAILED");
#define Net_Event_AlreadyConntected Net_EventGetID("ID_ALREADY_CONNECTED");
#define Net_Event_NewIncommingConntection Net_EventGetID("ID_NEW_INCOMING_CONNECTION");
#define Net_Event_NoFreeConntections Net_EventGetID("ID_NO_FREE_INCOMING_CONNECTIONS");
#define Net_Event_Disconnected Net_EventGetID("ID_DISCONNECTION_NOTIFICATION");
#define Net_Event_ConntectionLost Net_EventGetID("ID_CONNECTION_LOST");
#define Net_Event_ConntectionBanned Net_EventGetID("ID_CONNECTION_BANNED");
#define Net_Event_InvalidPassword Net_EventGetID("ID_INVALID_PASSWORD");
#define Net_Event_ModifiedPacket Net_EventGetID("ID_MODIFIED_PACKET");
#define Net_Event_A6Var Net_EventGetID("ID_A6_VAR");
#define Net_Event_A6Array Net_EventGetID("ID_A6_ARRAY");
#define Net_Event_A6String Net_EventGetID("ID_A6_STRING");
#define Net_Event_A6Entity Net_EventGetID("ID_A6_ENTITY");
#define Net_Event_A6ChatMessage Net_EventGetID("ID_A6_CHAT_MESSAGE");
#define Net_Event_A6BlacklistFilteredItem Net_EventGetID("ID_A6_SV_BLACKLIST_FILTERED_ITEM");

#define Net_Event1 101
#define Net_Event2 102
#define Net_Event3 103
#define Net_Event4 104
#define Net_Event5 105
#define Net_Event6 106
#define Net_Event7 107
#define Net_Event8 108
#define Net_Event9 109
#define Net_Event10 110
#define Net_Event11 111
#define Net_Event12 112
#define Net_Event13 113
#define Net_Event14 114
#define Net_Event15 115
#define Net_Event16 116
#define Net_Event17 117
#define Net_Event18 118
#define Net_Event19 119
#define Net_Event20 120
#define Net_Event21 121
#define Net_Event22 122
#define Net_Event23 123
#define Net_Event24 124
#define Net_Event25 125
#define Net_Event26 126
#define Net_Event27 127
#define Net_Event28 128
#define Net_Event29 129
#define Net_Event30 130
#define Net_Event31 131
#define Net_Event32 132
#define Net_Event33 133
#define Net_Event34 134
#define Net_Event35 135
#define Net_Event36 136
#define Net_Event37 137
#define Net_Event38 138
#define Net_Event39 139
#define Net_Event40 140
#define Net_Event41 141
#define Net_Event42 142
#define Net_Event43 143
#define Net_Event44 144
#define Net_Event45 145
#define Net_Event46 146
#define Net_Event47 147
#define Net_Event48 148
#define Net_Event49 149
#define Net_Event50 150
#define Net_Event51 151
#define Net_Event52 152
#define Net_Event53 153
#define Net_Event54 154
#define Net_Event55 155
#define Net_Event56 156
#define Net_Event57 157
#define Net_Event58 158
#define Net_Event59 159
#define Net_Event60 160

#endif




Have a nice day,
TWO alias Bloodline

Re: A6Network - Final Beta [Re: TWO] #135853
06/11/07 22:11
06/11/07 22:11
Joined: Jan 2004
Posts: 2,013
The Netherlands
E
Excessus Offline
Expert
Excessus  Offline
Expert
E

Joined: Jan 2004
Posts: 2,013
The Netherlands
Hi TWO,

I have a few questions regarding the design of your plugin and how it can be used (since it is a bit difficult to grasp the ideas by just looking at the code):

-Is it possible to send messages between servers or between clients?
-I see you are using an int to specify to what client to send a message. How can the server obtain the int of a specific client? Is it persistant (i.e. can it be used to relate client data or use it in a list of clients? Can it be refered to across the network)?
-Net_ClSendVar uses a char*. Does this mean you are sending variables by name? Does that mean long variable names will take more bandwidth? Can we send variables by their pointer (since the pointer has a differnt name than the variable)?

Re: A6Network - Final Beta [Re: Excessus] #135854
06/12/07 11:04
06/12/07 11:04
Joined: Aug 2005
Posts: 343
Germany
HPW Offline
Senior Member
HPW  Offline
Senior Member

Joined: Aug 2005
Posts: 343
Germany
How does VOIP work? Is there only one channel for all clients to chat or can you make a chatroom (create new channel/room) like system?


Evil Blood (v. 0.52) RPG
Commport.de (Social Network Community)
Re: A6Network - Final Beta [Re: HPW] #135855
06/12/07 13:02
06/12/07 13:02
Joined: Jan 2006
Posts: 1,829
Neustadt, Germany
T
TWO Offline OP

Serious User
TWO  Offline OP

Serious User
T

Joined: Jan 2006
Posts: 1,829
Neustadt, Germany
Excessus,

- No, this is both neither plant nor possible yet
- Yes and no; I've a list on every client and on the server who has got the var name/ID pair. So I only send the name the first time per client.
- The number for every client is static (on this server instance); The number of the joining client should be passed to the event like this:

function NetClient(var ClientID)
{
// Do stuff
}

Net_SvEventSetFunction(Net_Event_NewIncommingConntection, "NetClient");

HPW,

I've got problems with the VOIP system, but you can anyway try it (Cl and server NOT on the same PC). Run Net_SvVoiceStartup(); or Net_ClVoiceStartup(); after creating the server/client instance. Then, after the client is connected, call Net_ClVoiceRequestChannel(); on the client.

Re: A6Network - Final Beta [Re: TWO] #135856
06/12/07 14:34
06/12/07 14:34
Joined: Apr 2006
Posts: 1,551
Netherlands
D3D Offline
Serious User
D3D  Offline
Serious User

Joined: Apr 2006
Posts: 1,551
Netherlands
Nice another Raknet plugin I'll try the new version on my computer is it the same as the plugin Exessus is working on?

Just tried it and like with Exessus plugin I get 100% CPU usage on my pc. Also got a malfunction with message that it was a beta and not supposed to see this box after clicking on SERVER, but its normal as you say? After few times my computer crashed. Tested on A7.03 version.

Edit: High CPU usage sovled if you can tell me where to change ThreadSleepTime? I can't find it in the script.


smile
Re: A6Network - Final Beta [Re: D3D] #135857
06/12/07 16:38
06/12/07 16:38
Joined: Jan 2006
Posts: 1,829
Neustadt, Germany
T
TWO Offline OP

Serious User
TWO  Offline OP

Serious User
T

Joined: Jan 2006
Posts: 1,829
Neustadt, Germany
Yes, that's why I posted it The plugin isn't in release quality yet, but as there are popping up other MP plugins I want to take part in this competition.

Yes², this is because a maybe want to sell it in the future.

Yes³, but I've fixed times for both (the raknet and my receiver) threads; This is needed because if you set it to a value higher than 0, windows will raise it auto to 30+ and other applications can even raise it further. If you really want such a var I will give you one, but I fiddled around many weeks if there's a better solution.

Re: A6Network - Final Beta [Re: TWO] #135858
06/13/07 17:51
06/13/07 17:51
Joined: Apr 2006
Posts: 1,551
Netherlands
D3D Offline
Serious User
D3D  Offline
Serious User

Joined: Apr 2006
Posts: 1,551
Netherlands
Don't understand how is it fixed for both? It is good that the server use constant 100% CPU? Here it becomes very unresponsive and brings XP on its knees to force a reboot of the system then it displays message your system has recovered from a severe crash or something like that.


smile
Re: A6Network - Final Beta [Re: D3D] #135859
06/13/07 17:53
06/13/07 17:53
Joined: Jan 2006
Posts: 1,829
Neustadt, Germany
T
TWO Offline OP

Serious User
TWO  Offline OP

Serious User
T

Joined: Jan 2006
Posts: 1,829
Neustadt, Germany
No this isn't good for sure, but setting them to a higher values makes the plugin only usable for slow or round based games, not for a faster gameplay.

Re: A6Network - Final Beta [Re: TWO] #135860
06/13/07 17:58
06/13/07 17:58
Joined: Apr 2006
Posts: 1,551
Netherlands
D3D Offline
Serious User
D3D  Offline
Serious User

Joined: Apr 2006
Posts: 1,551
Netherlands
Okay, but what kind of OS, cpu and or how much memory does Raknet needs for it not to use 100% CPU? This system 2,6ghz 1gb with XP. Cannot test on other PC because it not yet finished building. With 100% CPU it becomes to unstable for any server. Are all Raknet powered MP applications showing this behaviour?


smile
Re: A6Network - Final Beta [Re: D3D] #135861
06/15/07 18:31
06/15/07 18:31
Joined: Apr 2006
Posts: 1,551
Netherlands
D3D Offline
Serious User
D3D  Offline
Serious User

Joined: Apr 2006
Posts: 1,551
Netherlands
Noticed it only required adding fps_max=60; to the main function in the script to get rid of the 100% CPU usage with Exessus plugin. I'll try if it works for A6N too.


smile
Page 1 of 3 1 2 3

Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1