jbruening / pnet Goto Github PK
View Code? Open in Web Editor NEWNetworking middleware for unity using Lidgren, with a custom dedicated server. This library is now obsolete in favor of its successor: https://bitbucket.org/jbruening/pnet2
Networking middleware for unity using Lidgren, with a custom dedicated server. This library is now obsolete in favor of its successor: https://bitbucket.org/jbruening/pnet2
Simply put, make it so each room's updating, as well as all the gameobjects in it, are on a thread specific to that room.
I might be doing this wrong but when I try and run the patch included for Lidgren so I can build it properly I get this
C Lidgren.Network\Lidgren.Network.csproj
rejected hunk @@ -10,7 +10,7 @@ hunk @@ -27,6 +27,7 @@ already applied rejected hunk @@ -38,6 +39,7 @@ rejected hunk @@ -47,11 +49,12 @@
G Lidgren.Network\NetBuffer.cs
hunk @@ -69,8 +69,39 @@ already applied
G Lidgren.Network\NetConstants.cs
hunk @@ -33,7 +33,7 @@ already applied
C Lidgren.Network\NetPeer.Internal.cs
rejected hunk @@ -1,5 +1,5 @@
C Lidgren.Network\NetUtility.cs
rejected hunk @@ -17,7 +17,7 @@
Summary of conflicts:
Text conflicts: 3
I have issues.
( I deleted already, cannot quote).
There is many methods with Recycle() It takes wrong parameter. It wants NetIncomingMessage but the variable type is NetOutgoingMessage ( or inversed ).
So couldn't test it.
Hi. My name is Tom. I sent you a PM in Unity Forums. I started testing PNet on your server example this week with Jitter Physics which looks good though very basic at this point. The server spawns a local NPC in the BasicRoom which jumps and move's around at random using Jitter. The client players however send their positions which the server only relays their movements back to the clients using Unity physics.
Taking things a step further. I updated my clients to Serialize a Byte Enum of player movements like LEFT, RIGHT, FORWARD, BACK, JUMP, yada and then have the server calculate the player positions authoritively sending the movement back to the clients.
What I find odd is that the client who is sending movement commands isn't actually getting any position data back from the server (Serialize is not firing on the Servers PlayerComponent). If I start the NPC on the local server. My OnDeserializeStream on the server side's PlayerComponent seems to be getting Both my NPC Vector 3 data and my Unity client Enums data (Controller commands). So I'm at a loss to what's going on. Also note the Serialize callback only starts firing on the server side when the NPC starts up. It seems Serialize starts firing when I have more than one client connected. Also I find it odd that if I decide not to send any controller commands on the client side (Player remains still) the Server side OnDeserializeStream still reports data even when I stop the NPC.
I'm doing what I can to check ownership of the network view so that the sends and receives don't get mixed up but I'm confused as to what's being broadcasted to everyone, to just the server, to just a player and to even back to one's self.
So if you can give me any tips / advice please do thanks.
I have come to love this lib over the past week, but there are a lot of things I can't grasp, what I was asking is do you have any internal documentation that you use, I want to make a full fledged demo multilayer game and post the code along with explanations, on the wiki, so other people can get into it more easily. I went though the Example but it leaves a good amount left to be desired. Just to clarify I don't want to to work on the example and turn it into a game I just want some documentation so I can work on building a example game(s). any help would be appreciated.
P.S. sorry if this was the wrong place to post it but I see no other way to contact you.
I noticed that Lidgren has a peer/server discovery system, and that PNet implemented that in a way, but I don't see a way to actually send Discovery Request message to the server in any way.
I wanted to know if I could disable the Unity side debugging code in the console, and if I can what do I need to change
I cloned your code, I made sure to use the exact revision of Lidgren you are talking about, and I followed all the instructions about slimmath and such.
However when I run the code it seems to be working, until I connect a client. At which point I get a constant flow of errors
System.NullReferenceException: Object reference not set to an instance of an obj
ect.
at Lidgren.Network.NetConnection.Heartbeat(Single now, UInt32 frameCounter) i
n d:\Development\Olympus\Server\PNet\Lidgren.Network\NetConnection.cs:line 260
at Lidgren.Network.NetPeer.Heartbeat() in d:\Development\Olympus\Server\PNet\
Lidgren.Network\NetPeer.Internal.cs:line 383
at Lidgren.Network.NetPeer.NetworkLoop() in d:\Development\Olympus\Server\PNe
t\Lidgren.Network\NetPeer.Internal.cs:line 228
I am using your example server/example client, and this is the error I am getting, no customization. Am I doing something wrong that might not be documented?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.