Jump to content




CraftServer v0.0.1


4 replies to this topic

#1 ShadowDisruptor

  • Members
  • 74 posts

Posted 29 November 2014 - 04:47 PM

Why is CraftServer so useful?
Have you ever wanted a few computers to be able to access the same variables? Have you ever wanted a place to store all of your data? Well, CraftServer may just be the solution for you. CraftServer alone is a pretty simple code. It's only about 35 lines. The client you use to interact with CraftServer makes the difference.

Users will have the ability to create their own clients to interact with a network of CraftServers. This way, users can have all of the features they want. You may be asking, what's this 'client' you're talking about? Well, a client is basically a manager. When you want to get, set, or delete a variable, you talk with the manager instead of the servers directly. Managers should manage storage space, manage variables across multiple CraftServers, and be able to handle any incoming requests. A client should also allow for a user to view data in the servers without using rednet (For example, a console)

How does it work?
A CraftServer works by saving variables to a file. It has a small bit of code to do extremely basic transfers. The reason the built-in code is so small is to allow for more variables to be stored on the computer. This is the reason a client is needed to interact with a server. You can find the updated code below.

Note, the current code has not yet been tested and requires ComputerCraft 1.6+ The CraftServer code should work fine, but ShadowServer is in early alpha.
CraftServer code
ShadowServer (My client to interact with CraftServer)

Edited by ShadowDisruptor, 29 November 2014 - 04:50 PM.


#2 jaredallard

  • Members
  • 124 posts
  • LocationSeattle, WA

Posted 29 November 2014 - 04:50 PM

Pretty unique code, I would say, but it needs some improvements. First of all, you should search all the sides to find any sort of modem instead of hardcoding it to use the back one. Second of all, have a server version checking aspect of the program so updated clients won't work with outdated servers :P

#3 ShadowDisruptor

  • Members
  • 74 posts

Posted 29 November 2014 - 04:59 PM

View PostRainbowDashDC, on 29 November 2014 - 04:50 PM, said:

Pretty unique code, I would say, but it needs some improvements. First of all, you should search all the sides to find any sort of modem instead of hardcoding it to use the back one. Second of all, have a server version checking aspect of the program so updated clients won't work with outdated servers :P

After I test it I plan to add in the modem checking. It's hard-coded atm to minimize the issues I could run into when testing it's actual function. The only way I know how to do update checks is downloading files from pastebin, which is a bit excessive. If you can show me a better way, be my guest!

#4 jaredallard

  • Members
  • 124 posts
  • LocationSeattle, WA

Posted 29 November 2014 - 05:43 PM

View PostShadowDisruptor, on 29 November 2014 - 04:59 PM, said:

After I test it I plan to add in the modem checking. It's hard-coded atm to minimize the issues I could run into when testing it's actual function. The only way I know how to do update checks is downloading files from pastebin, which is a bit excessive. If you can show me a better way, be my guest!

I don't mean updating the server software itself, I mean when the client interacts with the server it checks the server version protocol version and checks to see if they both are using the same protocol, if it passes, it will connect to that server and do x,y,z. If it does not pass, then it will state protocol version differs from own expected 'some number' got 'some number' or something among those lines.

#5 ShadowDisruptor

  • Members
  • 74 posts

Posted 29 November 2014 - 06:24 PM

View PostRainbowDashDC, on 29 November 2014 - 05:43 PM, said:

View PostShadowDisruptor, on 29 November 2014 - 04:59 PM, said:

After I test it I plan to add in the modem checking. It's hard-coded atm to minimize the issues I could run into when testing it's actual function. The only way I know how to do update checks is downloading files from pastebin, which is a bit excessive. If you can show me a better way, be my guest!

I don't mean updating the server software itself, I mean when the client interacts with the server it checks the server version protocol version and checks to see if they both are using the same protocol, if it passes, it will connect to that server and do x,y,z. If it does not pass, then it will state protocol version differs from own expected 'some number' got 'some number' or something among those lines.
Hmm, that's a pretty good idea. I will implement, but I doubt it will receive much use because the CraftServer code itself won't likely change much at all. The only change I can think of is also creating a single-file version of CraftServer which would just be slower than the current version.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users