Malazan Empire: PHP - Malazan Empire

Jump to content

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

PHP Just an idea I have

#1 User is offline   alt146 

  • Here comes the Strongbad!
  • Group: High House Mafia
  • Posts: 827
  • Joined: 29-September 08
  • Location:Pretoria ZA

Posted 21 March 2009 - 09:31 AM

So I was wondering if anyone here has a bit of experience using PHP.

I thought we could try put together a mod aid to use in conjunction with spoiler heaven. Basically something small that we can host somewhere (I'm pretty sure we wont be allowed to do it here) the way Maccy resolves sheep. It would consist of a page where you can set up a new game, putting in a list of alts, length of days etc. Once the game has started there would be a page that allows you to record when votes are made or removed and automatically outputs the current votecount to be copied into the thread. It would also record who died during the night and who is still alive. Does anyone think this is worth looking into? Obviously it wouldnt work for complicated games with wierd mechanics, but it would help get rid of counting and time errors in simpler games.

I dont think it would be too hard to do, since it would basically be a couple of inputs and one or two simple algorithms. I'd do it myself, but I've never used PHP before and it would be a bit of overkill to make something that runs with C or java.
[url="http://www.alt146.zzl.org"]MafiaManager[/url]: My Mafia Modding tool - Now at v0.3b

With great power comes a great integral of energy over time.
0

#2 User is offline   Aptorian 

  • How 'bout a hug?
  • Group: The Wheelchairs of War
  • Posts: 24,781
  • Joined: 22-May 06

Posted 21 March 2009 - 09:41 AM

Am I the only one comming in here mistakingly thinking this was a thread about PCP? :X
0

#3 User is offline   Morgoth 

  • executor emeritus
  • Group: High House Mafia
  • Posts: 11,448
  • Joined: 24-January 03
  • Location:the void

Posted 21 March 2009 - 01:11 PM

I think i've seen this over at westeros. IT would be awesome if some smart person could set it up
Take good care to keep relations civil
It's decent in the first of gentlemen
To speak friendly, Even to the devil
0

#4 User is offline   alt146 

  • Here comes the Strongbad!
  • Group: High House Mafia
  • Posts: 827
  • Joined: 29-September 08
  • Location:Pretoria ZA

Posted 21 March 2009 - 02:04 PM

View PostMorgoth, on Mar 21 2009, 03:11 PM, said:

I think i've seen this over at westeros. IT would be awesome if some smart person could set it up


Did anyone at Westeros ever get something set up?

Well I'm reading up on php basics, since something like that or perl would be the best to use for a web-based app. I think web-based would be the way to go, then multiple mods can use the one page. The biggest problem is to do it without using a database, since there are lots of places that you can host a couple of pages for free, but not that many that will give you access to a DB. That and DB creation and management is a pain in the ass, especially if you want to do it right.

So I'm see what I can whip up, if anyone wants to lend me a hand just post here or send me a pm.
[url="http://www.alt146.zzl.org"]MafiaManager[/url]: My Mafia Modding tool - Now at v0.3b

With great power comes a great integral of energy over time.
0

#5 User is offline   Sixty 

  • Don't be fooled. I am very serious.
  • Group: High House Mafia
  • Posts: 762
  • Joined: 01-December 08
  • Location:New Hampshire

Posted 21 March 2009 - 06:47 PM

I know a damn lot about php/mysql and I'd be welcome to set this up.

Although I won't have a lot of free time over the next couple months with track season, so it might take a couple weeks.

I also host my own website so hosting the script = no problem.

The biggest trouble is user authentication via alt accounts, which I do not have a lot of experience working with. I'd have to look into that. =/

Also, how would that incorporate into game itself? Would people still have to post vote-whoever in their posts? etc.

This post has been edited by Sixty: 21 March 2009 - 07:09 PM

0

#6 User is offline   Jump Around 

  • Weasel
  • Group: High House Mafia
  • Posts: 241
  • Joined: 01-December 06
  • Location:Milan, Italy

Posted 21 March 2009 - 07:08 PM

Was it Dinivan who had something like this? I remember it was brilliant to count the votes: you had drop-down menus for every living player to select who they were voting for, and it would generate automatically the vote update text.
0

#7 User is offline   Sixty 

  • Don't be fooled. I am very serious.
  • Group: High House Mafia
  • Posts: 762
  • Joined: 01-December 08
  • Location:New Hampshire

Posted 21 March 2009 - 07:16 PM

Huh I guess I misunderstood. That'd be extremely easy...<1 hour work to do.
Although I guess more variables are welcome.

I'm thinking (using this as a notepad now):

Create row game in table mafia_games
-id (auto_increment), name (as an identifier), start_time, day_length, night_length

And for each mafia_games row, there are several mafia_players and mafia_gameplayer

where mafia_players defines each alt available, and mafia_gameplayer has id's to reference mafia_players and mafia_games in order to list all alts playing in a game.

Each day/night end would have to be entered manually into the page (to figure out the time remaining).

And then the input->display page would involve inputting each vote by whom.

Okay, maybe more than an hour. :X
0

#8 User is offline   alt146 

  • Here comes the Strongbad!
  • Group: High House Mafia
  • Posts: 827
  • Joined: 29-September 08
  • Location:Pretoria ZA

Posted 22 March 2009 - 09:29 AM

View PostSixty, on Mar 21 2009, 09:16 PM, said:

Huh I guess I misunderstood. That'd be extremely easy...<1 hour work to do.
Although I guess more variables are welcome.

I'm thinking (using this as a notepad now):

Create row game in table mafia_games
-id (auto_increment), name (as an identifier), start_time, day_length, night_length

And for each mafia_games row, there are several mafia_players and mafia_gameplayer

where mafia_players defines each alt available, and mafia_gameplayer has id's to reference mafia_players and mafia_games in order to list all alts playing in a game.

Each day/night end would have to be entered manually into the page (to figure out the time remaining).

And then the input->display page would involve inputting each vote by whom.

Okay, maybe more than an hour. X.gif


I really suck at setting up databases elegantly, but I dont mind scripting. I've set up LAMPP, but I'm battling with the SQL stuff, it's been forever since I did any database coding. The PHP itself is pretty easy, it just requires a different approach to the type of programming I do.

What I have in mind a system able to keep track of multiple games at once (since I'm sure the modcraft and Westeros people will also want to use it). It would be separate from the boards that the games are being run on, mods would keep it open in a separate tab to keep track of vote counts etc.

Each game would have it's own page, with the ability to add players, change game settings (day length etc), enter votes, record nightkills (these would have to be resolved by the mods) and modkills. It would keep track of time remaining and alert the mods when day or night had timed out; or when enough votes were recorded to qualify for a lynch. The mod is then given the option to begin the next day night phase and it starts the next timer. The most important feature would be the ability to create a nicely formatted votecount with time remaining, votes etc, as well as possibly a summary of the day's events.

My biggest problem is how to store all the info without a million different databases and tables, followed by the fact that I'm coding everything by hand in Kate, which takes forever. Would you mind pm'ing me some thoughts as to the database setup, as well as any suggestions for decent (free) IDEs.
[url="http://www.alt146.zzl.org"]MafiaManager[/url]: My Mafia Modding tool - Now at v0.3b

With great power comes a great integral of energy over time.
0

#9 User is offline   alt146 

  • Here comes the Strongbad!
  • Group: High House Mafia
  • Posts: 827
  • Joined: 29-September 08
  • Location:Pretoria ZA

Posted 22 March 2009 - 02:45 PM

Ok, I got me some free hosting and made a quick mock-up of what I want to achieve.

If you guys want to have a look it's here. Please note that it's still ugly as hell and none of the buttons actually do anything, but if you guys could let me know what you think of it and if I've missed anything you think is important please let me know.
[url="http://www.alt146.zzl.org"]MafiaManager[/url]: My Mafia Modding tool - Now at v0.3b

With great power comes a great integral of energy over time.
0

#10 User is offline   Sixty 

  • Don't be fooled. I am very serious.
  • Group: High House Mafia
  • Posts: 762
  • Joined: 01-December 08
  • Location:New Hampshire

Posted 22 March 2009 - 03:21 PM

Hmm that's somewhat different from what I was thinking; that'll involve even more databases.

How do you plan on having data entered? Do players input the data or does the mod do it manually?
0

#11 User is offline   alt146 

  • Here comes the Strongbad!
  • Group: High House Mafia
  • Posts: 827
  • Joined: 29-September 08
  • Location:Pretoria ZA

Posted 22 March 2009 - 03:31 PM

View PostSixty, on Mar 22 2009, 05:21 PM, said:

Hmm that's somewhat different from what I was thinking; that'll involve even more databases.

How do you plan on having data entered? Do players input the data or does the mod do it manually?


The Mod would do it manually. The players wouldnt be allowed access, it would run in parallel to spoilers. Whenever someone votes, or all the night actions have been resolved and stuff then the mods enter all the relevant info and it keeps track of who is alive, time remaining etc.
[url="http://www.alt146.zzl.org"]MafiaManager[/url]: My Mafia Modding tool - Now at v0.3b

With great power comes a great integral of energy over time.
0

#12 User is offline   Sixty 

  • Don't be fooled. I am very serious.
  • Group: High House Mafia
  • Posts: 762
  • Joined: 01-December 08
  • Location:New Hampshire

Posted 22 March 2009 - 04:45 PM

Seems viable, but once you add so many features it'll get too bulky IMHO...keep it simple or it becomes more complex/unwieldy than keeping track manually.

Not in the mood to think atm, but when I lay out some organization/database ideas I'll let you know. D:
0

#13 User is offline   alt146 

  • Here comes the Strongbad!
  • Group: High House Mafia
  • Posts: 827
  • Joined: 29-September 08
  • Location:Pretoria ZA

Posted 22 March 2009 - 04:51 PM

View PostSixty, on Mar 22 2009, 06:45 PM, said:

Seems viable, but once you add so many features it'll get too bulky IMHO...keep it simple or it becomes more complex/unwieldy than keeping track manually.

Not in the mood to think atm, but when I lay out some organization/database ideas I'll let you know. D:


Hehe, you could make things a helluva lot more complicated imho. I'm using three databases per game to keep track of everything. At the rate I'm going I might have it done by the end of the week depending on how much time I have spare.
[url="http://www.alt146.zzl.org"]MafiaManager[/url]: My Mafia Modding tool - Now at v0.3b

With great power comes a great integral of energy over time.
0

#14 User is offline   Sixty 

  • Don't be fooled. I am very serious.
  • Group: High House Mafia
  • Posts: 762
  • Joined: 01-December 08
  • Location:New Hampshire

Posted 22 March 2009 - 05:07 PM

3 databases? That means 3 mysql connections...

Try using my suggestion of linking multiple tables or something, because you don't need 3 simultaneous connections. That's wasting resources.
0

#15 User is offline   alt146 

  • Here comes the Strongbad!
  • Group: High House Mafia
  • Posts: 827
  • Joined: 29-September 08
  • Location:Pretoria ZA

Posted 22 March 2009 - 05:34 PM

View PostSixty, on Mar 22 2009, 07:07 PM, said:

3 databases? That means 3 mysql connections...

Try using my suggestion of linking multiple tables or something, because you don't need 3 simultaneous connections. That's wasting resources.


Egh, meant tables. One database, so only one connection. Not gonna go that hardcore on the table stuff, just gonna have it dump and retrieve info.
[url="http://www.alt146.zzl.org"]MafiaManager[/url]: My Mafia Modding tool - Now at v0.3b

With great power comes a great integral of energy over time.
0

#16 User is offline   alt146 

  • Here comes the Strongbad!
  • Group: High House Mafia
  • Posts: 827
  • Joined: 29-September 08
  • Location:Pretoria ZA

Posted 22 March 2009 - 07:07 PM

Ok, I've gotten the authentication and session stuff done. If anyone wants to have a look at the mockups (all the actual pages at this point) the test game's password is password.
[url="http://www.alt146.zzl.org"]MafiaManager[/url]: My Mafia Modding tool - Now at v0.3b

With great power comes a great integral of energy over time.
0

#17 User is offline   Macros 

  • D'ivers Fuckwits
  • Group: High House Mafia
  • Posts: 8,846
  • Joined: 28-January 08
  • Location:Ulster, disputed zone, British Empire.

Posted 28 March 2009 - 01:28 PM

great idea.

Iwas going to offer up some space, but you have it already, so I'll sit back and wait fort he finished articles.
then cast a disparaging eye over it whilst making snarky remarks about its ineffectual nature
0

#18 User is offline   alt146 

  • Here comes the Strongbad!
  • Group: High House Mafia
  • Posts: 827
  • Joined: 29-September 08
  • Location:Pretoria ZA

Posted 28 March 2009 - 04:03 PM

View PostMacros, on Mar 28 2009, 03:28 PM, said:

great idea.

Iwas going to offer up some space, but you have it already, so I'll sit back and wait fort he finished articles.
then cast a disparaging eye over it whilst making snarky remarks about its ineffectual nature


Hehe, the server I'm using at the moment is free, so it's slow as hell. Although I wouldn't put it on one of your guys servers until it's working properly. I should hopefully be done by the end of the week and you guys can put it through it's paces then. I'm still trying to work up the energy to user-proof it and parse all the inputs to protect against injection attacks and stuff. And there are a couple of things that the program doesnt really handle all that elegantly, but I'm too lazy to put in the amount of time right now, maybe after people start using it on a regular basis.
[url="http://www.alt146.zzl.org"]MafiaManager[/url]: My Mafia Modding tool - Now at v0.3b

With great power comes a great integral of energy over time.
0

#19 User is offline   Sixty 

  • Don't be fooled. I am very serious.
  • Group: High House Mafia
  • Posts: 762
  • Joined: 01-December 08
  • Location:New Hampshire

Posted 28 March 2009 - 04:26 PM

Yeah webhosting isn't exactly expensive though, maybe under $2-3 a month for something this small with NFSN. :ball:

Although my own account is available as well if you want to host it through mine.
0

#20 User is offline   alt146 

  • Here comes the Strongbad!
  • Group: High House Mafia
  • Posts: 827
  • Joined: 29-September 08
  • Location:Pretoria ZA

Posted 28 March 2009 - 05:15 PM

View PostSixty, on Mar 28 2009, 06:26 PM, said:

Yeah webhosting isn't exactly expensive though, maybe under $2-3 a month for something this small with NFSN. :ball:

Although my own account is available as well if you want to host it through mine.


It's not really the money thing I'm worried about, more the fact that it's wide open to injection attacks and not all too elegantly set up at this point so I'd rather keep it on a crappy free server till it's better set up...

NFSN?
[url="http://www.alt146.zzl.org"]MafiaManager[/url]: My Mafia Modding tool - Now at v0.3b

With great power comes a great integral of energy over time.
0

Share this topic:


  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users