home home

downloads files

forum forum

docs docs

wiki wiki

faq faq

Cube & Cube 2 FORUM


(mod brew) voting disabled creates problem

by phoenixsux on 11/10/2007 10:08, 18 messages, last message: 11/15/2007 20:17, 1356 views, last view: 04/11/2024 01:50

i don't know if it works diffrently when using localhost and network/inernet connect but here's the situation:
(btw - i've never tried the commands online, just multiple clients and the decdicated server one one machine with
>\connect localhost
...)

it appeared that any client that used the SetMaster command would take the admin setting from the current master regardless of password (eg:
>\setmaster 1 anInvalidPassword
would still set them as an admin and steal the master token from the current master - thus why i've begun tweeking these commands)

so i tweeked the command to make it
>\setmaster 'pass'
so that the password is checked everytime with the master password.

(i'll later add in other commands - such as
\>private
\>public
or ect... to control the
\>setmaster 0,1,2,3 setting)

i then provided a command to enable/disable voting. master command:
>\allowvoting 1
or
>\allowvoting 0

i then made a sperate command:
>\open 'mapname'
this allows the client player to open a map for single player or editing purposes. (the command
>\map 'mapname'
is now only used for online map voting. otherwise they can't open a map for singleplayer purposes because they don't have any setmaster admin athourity - they aren't connected to a server to get it.)

now here's the problem i'm having:
by default voting is disabled. (an admin has to login on a client machine and toggle it on) When the server first starts up, it can't load it's default map because voting is disabled and the server doesn't have admin authority to over-rule the disabled voting. (otherwise everything is perfect) I figured it's not working because bassicly the server is doing a 100% vote for the default map before other players connect thus no longer works because voting is disabled.

so how can i give the dedicated server the setmaster token so that it can run scripts/startup-defaults as though it's an admin logged in?

i'll admit i'm kinda muttling my way through C but i'm doing alright. some of the semantics i don't understand -

such as why i can't do
bool allowvoting = true;

and can only do
bool allowvoting;

(something about the static/dynamic quality of the varable)

(the above would solve the problem although i'd rather have it's default set to false)

if there's some documentation i missed on how to disable voting with exsisting settings or such then feel free to rub my nose in it because i'm a firm beleiver in RTFM.

   Board Index   

#1: ..

by yvfc_cebtenzzre on 11/10/2007 10:34

if you're working with C++, how about you get a book on C++.

Most people who don't understand a programming language and ask for help without actually providing a testcase (a small example which they have written which demonstrates the problem they are having) can never be trusted to accurately describe their problem.

1. get a book.
2. paste a code example.

eg:

$ cat > test.cpp
int main(void)
{
bool foo = true;
return 0;
}

$ g++ test.cpp -o test && echo it worked
it worked
$

See... now I already knew that I can declare foo and initialize it at the same time, contrary to what you claim - why should we have to _guess_ what you mean.

I hope this demonstrates my point.

reply to this message

#2: ..

by Grinch (has lost his cookie) on 11/10/2007 13:01

I failed to snatch master with invalid password; the problem you describe doesn't appear to exist. Are you sure you haven't introduced the bug?

Variables cannot be initialized with assignment operator everywhere in C++, you were probably attempting an in-class initialization. Data members are initialized in constructor.

struct foo
{
foo():allowvoting(false){...}

bool allowvoting;
};

reply to this message

#3: ..

by Drakas on 11/10/2007 21:41

Have you even heard of /mastermode ?

reply to this message

#4: Re: ..

by phoenixsux on 11/10/2007 21:49, refers to #2

"I failed to snatch master with invalid password; the problem you describe doesn't appear to exist. Are you sure you haven't introduced the bug?"

no, the problem was there before i tinkered with any network or console commands that are relevant to the issue (eg: i set run, crawl, walk, ect... command but those are still client side only and wouldn't effect the \setmaster command)

i've been testing with one dedicated server and 4 clients on a single machine with "\connect localhost".

i was using the -p switch to set the password on the dedicated.clients sending
\setmaster 1
would become admin (i confess i don't recall if it would happen with no password or with incorrect password, but they WOULD snatch the admin)

i currently have

fpsserver

case SV_CHANGEMAP
if (ci->master || allowvoting)
{
code
}
else
{
code
}

is there something else i could put in the condition to make it say

if (ci->master || allowvoting || [came.from.server or no.clients.connected?])
{

?


thanks explaining the declairation depending on struct use, Grinch, that explains why i've been stuck with
allowvoting = false by default.

-Waxy

~~~~~~~~~~~~~~~~~~~~~~~
ps: sorry i can't paste exact code, i forgot to backup my latest coding from the computer i use at work.

reply to this message

#5: ..

by phoenixsux on 11/10/2007 21:50

mastermode? i may of over looked that command, i can't recall. i'll take a look at it. thanks, drake.

reply to this message

#6: Re: ..

by Drakas on 11/11/2007 11:55, refers to #5

I'm not drake.

reply to this message

#7: Re: ..

by SanHolo on 11/11/2007 12:49, refers to #6

Of course you're not, Darkass. ;D ;D ;D

reply to this message

#8: Re: ..

by Drakas on 11/11/2007 21:36, refers to #7

-_-

reply to this message

#9: Re: ..

by tentus_ on 11/11/2007 22:02, refers to #8

Could be worse, Drakas. I am always referred to as "Tetanus" at the LANS we have on campus. At least you get to be a cool lizard, and not a painful medical condition.

reply to this message

#10: Re: ..

by demosthenes on 11/12/2007 07:42, refers to #9

Pff! Try mine! It's nigh unpronounceable, so I end up getting called "demoss", or "moss", or "demo", or even by whatever clan tags I have on at the time (or not, depending on game). I've started just using "Lyqyd" instead, 'cause it's simple.

reply to this message

#11: Re: ..

by tentus_ on 11/12/2007 07:56, refers to #10

Aw, it'd be cooler if you switched to Locke. Not many would get it though.

(I am a big enough Orson Scott Card fan as to have reworked my class schedule so I could take his Speculative Fiction 3515 course. It was awesome.)

Why do we choose such strange names? Mine's Latin, demosthenes is Greek, Drakas is... South African? Not real sure.

reply to this message

#12: Re: ..

by demosthenes on 11/12/2007 09:46, refers to #11

I considered going with Peter's at first, but decided that Valentine's was where it's at. Plus, the name is more often available than Locke is.

I've got all the books from both series splits upstairs. I think my favorite is Children of the Mind, of Card's books.

You read Dune?

reply to this message

#13: Re: ..

by tentus_ on 11/12/2007 15:18, refers to #12

Made it to the fifth book before burning out, yes. I'd probably say my favorite Card book is Ender's Shadow, but it's got some serious competition.

reply to this message

#14: ..

by MovingTarget on 11/12/2007 15:57

Everybody thinks my name is too long. So I get called MT. No problem :-)

reply to this message

#15: ..

by SheeEttin on 11/12/2007 16:44

People have problems with my name all the time... The only thing that's repeatable is "sheeting".

reply to this message

#16: Re: ..

by JadeMatrix on 11/12/2007 21:25, refers to #11

...And then the topic degenerates into a name-fest XD

I get the reference. I\'ve read the entire Ender\'s Game mini-series, but the Ender\'s Shadow series was too boring or something... I just read the ending.

My name comes from Xenocide, I believe.

reply to this message

#17: Re: ..

by demosthenes on 11/12/2007 22:43, refers to #13

Ah! You're missing out on Chapterhouse and the House and Jihad prequel trilogies.

Not to mention Hunters and Sandworms of Dune, numbers 7 and 8. I'm ordering 8 after I get my gift cards for Christmas, which is far longer than I wanted to wait.

reply to this message

#18: ..

by phoenixsux on 11/15/2007 20:17

Ok, for anyone else who comes across this problem -

the way the server works with map change:

dedicated server starts with no map.
when the first client connects the server will /MAP to the client's map.

eg: you connect to the server with the map COMPLEX open in the client, and you're the only client on the server, then the server will switch to client.

when the round change time comes the server will force clients to vote for the next map during intermission.

it keeps track of if it's the round change map vote using the varable mapreload (if i recall correctly)

eg: if someone calls a vote and it's !mapreload then it's a regular vote. else the clients are telling the server the next map for the server to open in the series.

you can control this by the command in the server vote(name,mode, sender) (if i recall correctly)
simply replace name with "complex" or some map name generated by a script or command line option.



reply to this message

   Board Index   


Unvalidated accounts can only reply to the 'Permanent Threads' section!


content by Aardappel & eihrul © 2001-2024
website by SleepwalkR © 2001-2024
53865489 visitors requested 71640635 pages
page created in 0.022 seconds using 10 queries
hosted by Boost Digital