[redux3]Creating web based controller.

09/04/2015 00:05 DePredaTe#1
hey elitepvpers, been out for a LONG time. I've gotten into PHP and I'm decent at it now but i'm looking to improve my skills along with learning C#.

WHAT I'M DOING:
Currently I'm making a web controller for pro4never's redux3 source.

WHAT IT CAN DO:
As of right now it uses redux's user system to login, although i'm looking at encryption for a little bit of added security. You can stop, start, and restart the server and also install new instances. (Still have to figure out the running dual servers on one machine.(but then again why would you want to?)) You can completely control the users via database.

WHAT I'M WORKING ON:
"bash" like scripts for kicking, and live editing characters. Tools for spawning NPC's, creating quests and shops. A working in-game to web chat.

The reason I'm working on this is to learn class/function (OOP) and sockets. Regardless of how far I get before I decide to move on, i'll release a stable version of what I have.

WHAT I'M ASKING:
Come up with some things for me to do to learn off of. None of this, "create a server using PHP."

NOTE:
This wouldn't be a plug and play script. It would take editing your server to work with the PHP. Therefore at least beginner level (like me) knowledge of C#.
09/04/2015 03:49 Spirited#2
C# ASP.NET HTML5 web application using the MVC design pattern. Bootstrap and JQuery for client aesthetics and functionality. Those are my suggestions.
09/04/2015 04:23 pro4never#3
Fang is correct and it's exactly the route you wanna go.

It would require pretty much a full re-design of the core server logic though to allow you to properly interact with it but it IS the correct way to approach it (and allows for some truly phenomenal things not done by any active pserver out there like live updates on active events as they play out)
09/04/2015 04:58 DePredaTe#4
I've never really worked with ASP.NET, but the last ten or fifteen minutes or so it definitely interests me. I was planning on working solely with php, jquery, and bootstrap. I'll look more into asp.net and hopefully I can set a pretty good learning pace.
Considering the servers are actually written in C# it would make it easier for everyone to understand what is happening, where, and why. Where as some people have absolutely no experience with PHP will look at it and not even understand a variable. With all that said, I now agree with you two.
09/04/2015 07:16 Spirited#5
Life begins at the end of your comfort zone.
09/04/2015 10:30 Xio.#6
You could look into OWIN, that lets you host the webapp directly inside the redux source. Makes it easier to wire up everything. Just beware that if you fuck up the website somehow you could easily drag the entire server into the burning hellfire :P
09/04/2015 17:12 DePredaTe#7
I actually looked into something similiar, the issue with that is exactly what you mentioned. The other issue that also comes with writing it in asp.net is that, like pro4never said, would take rewritting the way the server runs. Making this very difficult to implement into existing servers.
09/04/2015 17:34 turk55#8
ConquerPS had something similar, they however used the world chat functionality on the website by communicating with the server using [Only registered and activated users can see links. Click Here To Register...].

I was going to have my way with it as well but I never really bothered with it.

Also, if I am correct you should also be able to send messages to C# applications using websockets. This way you could use commands while being on the webpage. (I never tested this theory)
09/04/2015 19:50 Best Coder 2014#9
Quote:
Originally Posted by turk55 View Post
Also, if I am correct you should also be able to send messages to C# applications using websockets. This way you could use commands while being on the webpage. (I never tested this theory)
Definitely possible, but you'll probably want to use a third party library, something like [Only registered and activated users can see links. Click Here To Register...], unless you actually want to implement the WebSocket protocol yourself, of course.
09/05/2015 04:15 Spirited#10
I would argue against such close contact with the server. It's best to keep things like that modular, and have them as two separate applications that (possibly) share the same database. No direct connections between the two. That way, you're not introducing new possibilities for bugs with the new socket connection, and you don't have accidental dependencies. Simplicity in design is also more maintainable and extendable.
09/05/2015 04:32 DePredaTe#11
How would you go about tying in live events without having direct connection with the server at some point in time? Online users, character kick/ban, chat server, event start, stop, reset? Web sockets to me, coming from php, sounds better just because of being able to use it for connecting, sending, disconnecting.
09/05/2015 04:46 Spirited#12
Quote:
Originally Posted by DePredaTe View Post
How would you go about tying in live events without having direct connection with the server at some point in time? Online users, character kick/ban, chat server, event start, stop, reset? Web sockets to me, coming from php, sounds better just because of being able to use it for connecting, sending, disconnecting.
You don't. Most of those things, such as displaying online users, can be executed through appropriate database management. Otherwise, things like kicking characters and stopping the server, should never be in a public-facing web server. This is where modular design really becomes important: separation of concerns. Decouple. If you want a chat server, have a chat server that's completely separate from the game and web server. If you want to administrate your server, have a back-end portal. This is extremely important with security as well, because you can then assign IP addresses to ports which should only be accessed by you. Amazon does this using private networks, and will allow you to create ports which cannot be detected in port scans. Just some things to consider; I follow older design patterns from the days of C very closely.
09/05/2015 13:41 DePredaTe#13
Well I believe, except for the chat server, that was what I was going to do(sort of.) This is just a way for me to learn C# at the same time as improving my PHP knowledge. With the websockets it wouldn't be a webserver. it would only be accessible by localhost(if anyone wants to do remote that's their own security issue.) PHP would do everything server side. I wanted it to work more or less like an API. PHP requests information from the websocket, the websocket gets the information from the redux server, websocket gives it to webserver, webserver gives information to PHP, PHP prints the information to the user. This is what I THOUGHT websockets was used for. I may be wrong though, considering I've never actually used them to build something of my own.
09/17/2015 18:03 iBotx#14
I've already done almost everything you're talking about using asp.net and a simple web server in your project.
09/18/2015 02:25 Spirited#15
Quote:
Originally Posted by iBotx View Post
I've already done almost everything you're talking about using asp.net and a simple web server in your project.
What do you mean almost everything? All you need to do is create a new project in Visual Studio. That's absolutely everything I mentioned. It can all be done in 1 minute, auto-generated by Visual Studio.