A6Network - Final Beta

Posted By: TWO

A6Network - Final Beta - 06/11/07 21:10

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
Posted By: Excessus

Re: A6Network - Final Beta - 06/11/07 22:11

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)?
Posted By: HPW

Re: A6Network - Final Beta - 06/12/07 11:04

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?
Posted By: TWO

Re: A6Network - Final Beta - 06/12/07 13:02

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.
Posted By: D3D

Re: A6Network - Final Beta - 06/12/07 14:34

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.
Posted By: TWO

Re: A6Network - Final Beta - 06/12/07 16:38

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.
Posted By: D3D

Re: A6Network - Final Beta - 06/13/07 17:51

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.
Posted By: TWO

Re: A6Network - Final Beta - 06/13/07 17:53

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.
Posted By: D3D

Re: A6Network - Final Beta - 06/13/07 17:58

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?
Posted By: D3D

Re: A6Network - Final Beta - 06/15/07 18:31

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.
Posted By: TWO

Re: A6Network - Final Beta - 06/15/07 18:33

Hey nice to know, Ill add this to my manual (if I even write one; noone seemss to be interested in a high-end mp engine ).
Posted By: D3D

Re: A6Network - Final Beta - 06/15/07 18:46

Would expect a somewhat enthusiastic response from everyone interested in making multiplayer games sure
Guess it is due that this plugin is for Lite-C and some still need to learn the language.
Posted By: fastlane69

Re: A6Network - Final Beta - 06/15/07 20:11

It's the same problem with people developing for Vista... it's so new, that you are developing for a small market.

The best (and only) way you can drum up attention to your product is to make something with it. Prove that it can be done and they will come.

But keep in mind that there are a handful of people working with Lite-C and only a handful of those are considering MP... so don't be discouraged if you don't get much of a response for the next 6 months or so while Lite-C a) stabilizes and b) gains popular acceptance.
Posted By: TWO

Re: A6Network - Final Beta - 06/16/07 07:00

Yes, that's the sad truth

Hmm, let use see... maybe writing an C-Script wrapper? Stay tuned
Posted By: Andreas C

Re: A6Network - Final Beta - 06/16/07 09:53

Quote:

Hey nice to know, Ill add this to my manual (if I even write one; noone seemss to be interested in a high-end mp engine ).




Can only speak for myself, but I'm quite interested ... but still learning Lite-C and still having to gain enough experience with "normal" gameplay before attempting to go into MP type games.

Cheers,
Andreas
Posted By: Raven75

Re: A6Network - Final Beta - 06/17/07 19:43

very interessted too. But started with lite-c some days ago. Tried to run the sample pong, but after the menu i got an error "acknex.exe caused an error and will be closed. start the programm again"
Posted By: Excessus

Re: A6Network - Final Beta - 06/17/07 20:19

Hi TWO,

It seems we are both suffering from the same or a similar problem.. I just tried to run your pong sample and it crashes. When I tried to create a small sample app, it crashed as soon as I tried to call an A6N function. When I look at the Acklog.txt, it doesn't say that the dll was loaded (it should when the dll is loaded correctly).

These are exactly the same problems I am having with my plugin. I have not found a solution yet, but I'll share it when I find something. Too bad jcl is out of the office, since this isn't the first time I've read about such problems and he would probably be able to help.

If you read my thread, you'll find more details about the problem.
Posted By: TWO

Re: A6Network - Final Beta - 06/18/07 13:47

Hey Excessus,
I'm very interested in a solution for this damn thing as all RakNet DLLs seems to have this problem (Do you remember my old one a year ago?). I asked JCL back then but never got a solution.

I just want to add,I released my DLL 1 or 2 hours after you released yours. This was not because I want to damage your glory, but I worked a very very long and difficult time on this project and I didnt want to loose all my good work. Hope you arent angry with me

TWO
Posted By: Excessus

Re: A6Network - Final Beta - 06/18/07 14:01

I'm not angry with you, competition is a good thing. I was actually aware of your plugin (so I knew what I was getting in to), but your plugin does not suit my needs. I don't like some design decisions you made (some awkward interfaces, limitations, etc.), but your plugin could very well be a good choice for certain projects. It sure is better than 3DGS MP. I'm not trying to put down your hard work either.

But as long as we don't get this thing fixed, nobody will be able to use either of our plugins.

When jcl gets back we should ask him to put some better diagnostics in the dll_open and acklog.txt regarding loading of dlls. Untill then, I'll keep on searching..

BTW, you are using Visual C++ Express right?
Posted By: TWO

Re: A6Network - Final Beta - 06/18/07 14:39

Nope, I won the standard version in a msdn lottery
Posted By: Raven75

Re: A6Network - Final Beta - 06/18/07 15:44

By the way I have no problem to pay for a easy to use solution.
I hope there are more people that think so and so are motivation you both
© 2024 lite-C Forums