logo
Main

Forums

Downloads

Unreal-Netiquette

Donate for Oldunreal:
Donate

borderline

Links to our wiki:
Wiki

Walkthrough

Links

Tutorials

Unreal Reference

Usermaps

borderline

Contact us:
Submit News
Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) Idea: Web admin API (Read 701 times)
ArtifexEt
New Member
*
Offline


Oldunreal member

Posts: 4
Location: Gdańsk
Joined: May 26th, 2014
Gender: Male
Idea: Web admin API
Mar 5th, 2018 at 9:07pm
Print Post  
I do not know if this is the best place to ask for a change current web admin page.
I realize that this is not the most important thing that can be improved. Probably not many people use this. But my solution could solve the problem of management via a web server and make it more convenient.
Please let me know if instead of patch mod will be better.

Story:

Currently web admin allows for basic management. It is based on generating html files using the game engine. This method of generation does not allow creating a complicated user interfaces. In theory, you can attach additional scripts to the html with the help of some external http server but this is just an apparent solution.

Proposition:

Create new api web server. The game engine would interpret and generate only data in the json format. Communication would be done using the rest api.

Advantages:
- Easy to implement on game engine side
- It allows you to increase game control
- Serialization of objects allows you to support every mod and state in game
- Well implemented can be universal (Unreal, UT etc)
- Everyone will be able to control the server using api
- it will be possible to create an application / management page for more than one game server at a time
- it will be possible to collect much more accurate server statistics, eg average health of players in a given stage, etc.
- it will be possible provide information about the number of players or server status on websites
- Anyone will be able to create a web admin page without having to modify the game

Why better patch than mod:
- You can share selected core elements of game as "modifiable"
- serialization should probably be done natively for optimization

What can I do:

- Create detailed documentation how api should look like.
- Create client application that use this api.
- Write high-level server architecture, to to speed up patch implementation
- Support the whole process

What I can not do:
- Write the unreal script code/c++, because I do not know it well enough
  
Back to top
IP Logged
 
Pitbull™
Forum Administrator
*****
Offline



Posts: 1049
Location: Between Venus & Mars
Joined: Oct 4th, 2002
Gender: Male
Re: Idea: Web admin API
Reply #1 - Mar 5th, 2018 at 10:54pm
Print Post  
I've always liked web admin as you can easily manage your server from any where. Your idea of an external server though. That kinda draws a red flag for me. I am by no means well versed in programming and I have basic knowledge of html etc. Would an external server allow for abuse? One thing I do think would be cool though would be a mobile version of web admin.
  

LOADING HATERS..████████████] 99% Complete.

It was only a difference of opinion, but really...I mean good manners
don't cost nothing do they, eh?
Back to top
IP Logged
 
ArtifexEt
New Member
*
Offline


Oldunreal member

Posts: 4
Location: Gdańsk
Joined: May 26th, 2014
Gender: Male
Re: Idea: Web admin API
Reply #2 - Mar 6th, 2018 at 1:51am
Print Post  
The threats will be at the same level as currently. The truth is that my idea is not very complicated. Because it is not much different from what we have today. We change html to json. The difference is only in server response format.

It would be possible to create a mobile application. I would stay with the control using the browser. However, everyone could create mobile admin app.

Of course, there are even better ways to create a web admin. For example, websockets But they seem to me much more invasive and not implemented correctly would affect the performance of the game itself.
  
Back to top
IP Logged
 
Pitbull™
Forum Administrator
*****
Offline



Posts: 1049
Location: Between Venus & Mars
Joined: Oct 4th, 2002
Gender: Male
Re: Idea: Web admin API
Reply #3 - Mar 6th, 2018 at 4:17am
Print Post  
For mobile wouldn't a mobile format work just as easily? I'd imagine most would rather have that instead. I hate installing tons of apps on my phone.
  

LOADING HATERS..████████████] 99% Complete.

It was only a difference of opinion, but really...I mean good manners
don't cost nothing do they, eh?
Back to top
IP Logged
 
Smirftsch
Forum Administrator
*****
Offline



Posts: 7686
Location: at home
Joined: Apr 30th, 1998
Gender: Male
Re: Idea: Web admin API
Reply #4 - Mar 6th, 2018 at 7:04am
Print Post  
in general any improvement is welcome and the idea to have a web admin suitable for mobile is also quite cool.
Somehow I find it a bit funny that our old game seems to get technology even modern games don't have Cheesy

I do not know much about json and what it can do other than that it exists. Therefor I can't overview right now how much effort this will take and since my time is usually very limited I can't say yet if such a project is feasible in any way.
Either way, I think there is interest and we should dig a bit deeper how many people want to contribute here and if we can realize it.
  

Sometimes you have to lose a fight to win the war.
Back to top
WWWICQ  
IP Logged
 
Feralidragon
Full Member
***
Offline



Posts: 192
Location: Lisbon - Portugal
Joined: Jul 24th, 2008
Gender: Male
Re: Idea: Web admin API
Reply #5 - Mar 6th, 2018 at 11:30am
Print Post  
For the record, I am currently working towards something similar, technology-wise.

I am creating a new PHP framework, which I am already starting to use at work, and which I also intend to use to build a fairly complete platform for both Unreal and UT99, and one of the last steps is for me to develop a JSON parser in UnrealScript, along with a few other things, which I have first to experiment with, such as a REST framework for UnrealScript as well (given that as it is, at least in UT99, I will have to rebuild the entire thing, which luckily can be done so with UnrealScript only), to retrieve data and render a view in-game.

What I mean to do sits mostly on the opposite side of what you want to do, as you want a web interface to interact with Unreal, while I want an Unreal interface to interact with web in the end (although I also want a web towards Unreal, but mostly in the sense of browsing a site, hit play and open Unreal from the client perspective), but the technologies are the same: JSON, REST, web interface, etc.
So I can already say that most if not all of this can be achieved through UnrealScript alone.



As for JSON itself, the biggest challenge is not to parse it (that's the easy part, the format is very simple), but rather what to translate it into in terms of Unreal data structures, given that going from weak typed to strong typed is always a challenge, while from strong typed to weak typed is very easy.
At least my own idea in how to do it is to use objects to represent it: a main JSON object while then is extended to represent other objects and arrays, and even scalar values such as numbers, strings, booleans, etc.

Although having objects where each JSON property directly translates to each Unreal object property is also possible, although yeah, it would be much easier to do it natively, but I don't think it's strictly required.



As for the entire REST communication... I am not sure how the current web admin works in terms of authentication (it's perhaps basic HTTP authentication?), but it could be a good moment to consider other stronger options to ensure that the API is more secure.
This could be done through HMAC, which involves hashing, generally using the SHA family of hashes (preferably SHA-256 nowadays), since it's a way to sign every request with a key and even check if the data has been tampered with during transmission, and that key doesn't have be sent ever, unlike normal credentials like user and password.

HMAC may also be processed with UnrealScript alone, and I am not sure if Unreal has already any hashing functions implemented (UT99 at least does not), but I already implemented the most used hashing functions several years ago using UnrealScript as well (MD5, SHA-1, SHA-224, SHA-256, SHA-384 and SHA-512), so in case someone already proceeds to develop something in this direction, I can provide the code I already did (it's old code though, but it should work well and be fairly fast).



Having all that said, given that I am now almost entirely focused in the PHP part (the web part), and will be so for several months at least, I won't be touching UnrealScript itself anytime soon to actually create this stuff, but if in the meanwhile someone advances with this, I may at least provide support either with the little code I already have or giving feedback in general in terms of the REST/HTTP/JSON implementation, if needed at all of course. Smiley
  
Back to top
IP Logged
 
ArtifexEt
New Member
*
Offline


Oldunreal member

Posts: 4
Location: Gdańsk
Joined: May 26th, 2014
Gender: Male
Re: Idea: Web admin API
Reply #6 - Mar 6th, 2018 at 4:41pm
Print Post  
What is json?

Quote:
json is an open-standard file format that uses human-readable text to transmit data objects consisting of attribute–value pairs and array data types (or any other serializable value). It is a very common data format used for asynchronous browser–server communication, including as a replacement for XML in some AJAX-style systems

So it is practically a properly formatted text file - like html, that is intended for data transfer, not for presentation. What format should have these files and what url should be used tp download them describes the REST.

Quote:
REpresentational State Transfer (REST), or RESTful, web services provide interoperability between computer systems on the Internet. REST-compliant web services allow the requesting systems to access and manipulate textual representations of web resources by using a uniform and predefined set of stateless operations. Other kinds of web services, such as WSDL and SOAP, expose their own arbitrary sets of operations

Rest provides rules how to download, create and modify resources. It does not exclude use of a different data format, eg, instead of json, you can send xml.

So why patch? As Feralidragon said. The entire plan requires serialization of uscript objects to the selected format and deserialization. The next step is to write (in uscript?)  web admin so that you can ask about specific objects. Eg:

url get: /game/level/players/ returns all players data in json format

And set selected object properties:

url post: /game/level/ {"levelUrl": "NaliLord"} which may cause navigation

Writing a mobile application that uses this API It's the simplest (for me) part. And I could do it by the way.

Because I work as frontend developer I did not consider communication using php treating it as another layer, especially with the main goal was to manage the server. But I could prepare examples of using this api in php, java or other languages.
  
Back to top
IP Logged
 
[]KAOS[]Casey
Developer Team
Betatester
Offline


nedm

Posts: 3115
Joined: Aug 7th, 2011
Gender: Male
Re: Idea: Web admin API
Reply #7 - Mar 6th, 2018 at 5:22pm
Print Post  
Feralidragon wrote on Mar 6th, 2018 at 11:30am:
but rather what to translate it into in terms of Unreal data structures, given that going from weak typed to strong typed is always a challenge, while from strong typed to weak typed is very easy.
At least my own idea in how to do it is to use objects to represent it: a main JSON object while then is extended to represent other objects and arrays, and even scalar values such as numbers, strings, booleans, etc.


SetPropertyText and GetPropertyText will do lots of things here for you. Watch out for arrays though...
  
Back to top
 
IP Logged
 
Feralidragon
Full Member
***
Offline



Posts: 192
Location: Lisbon - Portugal
Joined: Jul 24th, 2008
Gender: Male
Re: Idea: Web admin API
Reply #8 - Mar 7th, 2018 at 11:20am
Print Post  
Yes, I know about those. Smiley
They're very useful to change scalar properties, but once you try to change arrays or structs, and even class references (if I recall correctly), that's where they fail.

Although I probably won't use them at all, unless it's to do some kind of conversion that can only be achieved with those (such as string to name), although only as a polyfill in UT99, given that I believe in Unreal there's already a function for this?

Instead, what I am planning to do is to create actual objects (as in, extending Object rather than Actor), and each object representing a possible value or a set of values (arrays and objects).
Essentially, following the same kind of structure that weak typed languages use internally.

By doing it like that, I don't need to use those methods at all, and objects are the closest thing I can get to clean classes with no extras.
  
Back to top
IP Logged
 
Skupie
New Member
*
Offline


Oldunreal member

Posts: 1
Joined: Mar 7th, 2018
Re: Idea: Web admin API
Reply #9 - Mar 7th, 2018 at 3:38pm
Print Post  
Good idea
  
Back to top
 
IP Logged
 
ArtifexEt
New Member
*
Offline


Oldunreal member

Posts: 4
Location: Gdańsk
Joined: May 26th, 2014
Gender: Male
Re: Idea: Web admin API
Reply #10 - May 4th, 2018 at 8:54am
Print Post  
I know that some time has passed since the start of the topic. I still watching it.

Maybe it would help if I prepare some demo. I would like to see the admin panel made with the standards of google material.

I can do the web app. And if you like it, we can think how to connect it with this api.
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint
Bookmarks: del.icio.us Digg Facebook Google Google+ Linked in reddit StumbleUpon Twitter Yahoo