You last visited: Today at 13:21
Advertisement
[Release] Create your own base
Discussion on [Release] Create your own base within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.
07/30/2011, 01:18
#1
elite*gold: 12
Join Date: Jul 2011
Posts: 8,283
Received Thanks: 4,192
[Release] Create your own base
Hey. This was a requested tutorial. Nothing special really.
He wanted it to be called "educational source". See attached.
Attached Files
Educational Source.rar
(31.9 KB, 501 views)
07/30/2011, 03:58
#2
elite*gold: 0
Join Date: May 2011
Posts: 648
Received Thanks: 413
Lol. Seriously? Thats it?
Lemme guess... Erik wanted that XD
07/30/2011, 06:08
#3
elite*gold: 12
Join Date: Jul 2011
Posts: 8,283
Received Thanks: 4,192
Quote:
Originally Posted by
Y u k i
Lol. Seriously? Thats it?
Lemme guess... Erik wanted that XD
Hahaha, nah. I don't know his real name but it's not the Eric we know.
Basically, he wanted to know how to get started.
07/30/2011, 08:25
#4
elite*gold: 0
Join Date: Jun 2008
Posts: 113
Received Thanks: 19
Even though this is super tiny and all I honestly still like it
I like that you commented exactly what to do but left it to the person to actually get it done..I'm sure anybody that uses this will like that
Off Topic..
I just saw drunk hobos fighting at a sonic =D
07/30/2011, 09:10
#5
elite*gold: 0
Join Date: May 2011
Posts: 1,769
Received Thanks: 756
And I thought my source I made from scratch was a base :O
07/30/2011, 11:51
#6
elite*gold: 0
Join Date: Jul 2011
Posts: 39
Received Thanks: 2
Quote:
Originally Posted by
Y u k i
Lol. Seriously? Thats it?
Lemme guess... Erik wanted that XD
What is your problem ? I wanted it and Fang gave me !
07/30/2011, 15:05
#7
elite*gold: 0
Join Date: Jul 2011
Posts: 39
Received Thanks: 2
xD!
07/31/2011, 00:41
#8
elite*gold: 28
Join Date: Jun 2010
Posts: 2,226
Received Thanks: 868
Here's one void.
Code:
public DotNetSocket(ushort port)
{
_connection = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
_connection.Bind(new IPEndPoint(IPAddress.Any, port));
}
Just wanted to share. Got bored and made that small code.
#edit
Im bored, yes.
And i'm learning too! I've never really worked with socket classes, just used pre-made ones.
Fang,
I assume this is right for the start of the Connect void?
Code:
public void Connect(IAsyncResult result)
{
Wrapper _w = new Wrapper();
_w.Socket = _connection;
_connection.Accept();
ClientConnect.Invoke(_w);
?
07/31/2011, 01:18
#9
elite*gold: 12
Join Date: Jul 2011
Posts: 8,283
Received Thanks: 4,192
Quote:
Originally Posted by
_DreadNought_
Here's one void.
Code:
public DotNetSocket(ushort port)
{
_connection = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
_connection.Bind(new IPEndPoint(IPAddress.Any, port));
}
Just wanted to share. Got bored and made that small code.
#edit
Im bored, yes.
And i'm learning too! I've never really worked with socket classes, just used pre-made ones.
Fang,
I assume this is right for the start of the Connect void?
Code:
public void Connect(IAsyncResult result)
{
Wrapper _w = new Wrapper();
_w.Socket = _connection;
_connection.Accept();
ClientConnect.Invoke(_w);
?
Not quite. Read the comments that I put in there. You don't want to set the server's socket to the client's personal socket.
07/31/2011, 02:04
#10
elite*gold: 28
Join Date: Jun 2010
Posts: 2,226
Received Thanks: 868
You want to create a new instance
07/31/2011, 02:12
#11
elite*gold: 12
Join Date: Jul 2011
Posts: 8,283
Received Thanks: 4,192
Quote:
Originally Posted by
_DreadNought_
You want to create a new instance
Drifting further away... lol
My comments should tell you everything that you need to figure it out.
07/31/2011, 11:30
#12
elite*gold: 28
Join Date: Jun 2010
Posts: 2,226
Received Thanks: 868
Sorry was half asleep at 1am
I took one look and done it
Code:
Wrapper _w = new Wrapper();
_w.Socket = _connection.EndAccept(result);
_w.Socket.BeginAccept(Connect, new AsyncCallback(Receive));
ClientConnect.Invoke(_w);
most of that function.
07/31/2011, 20:03
#13
elite*gold: 12
Join Date: Jul 2011
Posts: 8,283
Received Thanks: 4,192
Quote:
Originally Posted by
_DreadNought_
Sorry was half asleep at 1am
I took one look and done it
Code:
Wrapper _w = new Wrapper();
_w.Socket = _connection.EndAccept(result);
_w.Socket.BeginAccept(Connect, new AsyncCallback(Receive));
ClientConnect.Invoke(_w);
most of that function.
Good job. =p You might want to put some checks on that to make sure that the client's socket isn't null.
PS: Don't check to see if it's Connected (that takes longer in ms).
09/06/2012, 16:45
#14
elite*gold: 0
Join Date: Jan 2011
Posts: 7
Received Thanks: 0
Wow, I can't believe I'm only finding this now o_0
Thank you Fang for doing this! I've been trying to learn how sockets work and this has helped me to understand!
Thanks again!
noblewarrior.
09/06/2012, 19:13
#15
elite*gold: 0
Join Date: Jun 2009
Posts: 378
Received Thanks: 141
Not to shabby, still I think between all the releases with the use of the search button anyone would find, many c# bases, even a c++ base to use as a starting point.
Kudo's to you sir for helping out the juniors. And good luck to ya'll.
All times are GMT +1. The time now is 13:22 .