Commit ca84887f authored by Bas Lijnse's avatar Bas Lijnse

Updated game examples with login instructions

parent cf6a9f5e
......@@ -4,23 +4,29 @@ module Ligretto
When creating a project, include the following paths:
(i) {Application}\Examples\iTasks\Games\
(ii) {Application}\Examples\iTasks\Graphics\
To run the example playing as two persons, do the following:
(a) first log in as root / root
(b) select the 'Manage users' task
(c) import a user community
(d) logout
(e) login as the key player who is going to invite 1, 2, or 3 players
(f) select the 'Ligretto' task
(g) select 1, 2, or 3 users to play Ligretto with
(h) open the newly created task
(i) in other browser( tab)s, login as the invited player(s) and open the task received from the key player
(j) have fun
*/
import Ligretto.Tasks
import MultiUser.Tasks
import iTasks.Extensions.Admin.WorkflowAdmin, Text.HTML
Start :: *World -> *World
Start world
= startMultiUserTasks [ workflow "Ligretto" "Play Ligretto" play_Ligretto ] [] world
Start world = doTasks
{WorkflowCollection
|name = "Ligretto"
,workflows = [ workflow "Host Ligretto" "Host a Ligretto game" play_Ligretto ]
,loginMessage = Just loginMessage
,welcomeMessage = Nothing
,allowGuests = False
} world
where
loginMessage = DivTag []
[Text "This example implements a simplified version of the card game Ligretto.", BrTag []
,Text "To play the game do the following:"
,OlTag []
[LiTag [] [Text "Log in as a demo user for example 'alice' (password alice), 'bob' (password bob) or 'carol' (password carol)"]
,LiTag [] [Text "Choose New -> 'Host Ligretto' -> 'Create task'"]
,LiTag [] [Text "Open the task in the task list and invite other players"]
,LiTag [] [Text "The others can also log in and will find the game waiting for them in their task list."]
,LiTag [] [Text "Have fun"]
]
]
definition module MultiUser.Tasks
import iTasks.Extensions.Admin.UserAdmin
startMultiUserTasks :: [Workflow] [StartableTask] *World -> *World
implementation module MultiUser.Tasks
import iTasks
import iTasks.Extensions.Admin.UserAdmin
startMultiUserTasks :: [Workflow] [StartableTask] *World -> *World
startMultiUserTasks workflows tasks world
= startTask [ workflow "Manage users" "Manage system users..." manageUsers
: workflows
] tasks world
startTask taskList tasks world
= doTasks [ onStartup (installWorkflows taskList)
, onRequest "/" browseExamples
: tasks
] world
where
browseExamples = forever (
enterInformation "Enter your credentials and login or press continue to remain anonymous" []
>>* [OnAction (Action "Login") (hasValue browseAuthenticated)
] )
browseAuthenticated {Credentials|username,password}
= authenticateUser username password
>>= \mbUser -> case mbUser of
Just user = workAs user manageWorkOfCurrentUser
Nothing = viewInformation (Title "Login failed") [] "Your username or password is incorrect" >>| return ()
module Trax
/** This example implements the two-person tile game Trax.
When creating a project, include the following paths:
{Application}\Examples\iTasks\Games\
To run the example playing as two persons, do the following:
(a) first log in as root / root
(b) select the 'Manage users' task
(c) import a user community
(d) logout
(e) login as the key player who is going to invite another player
(f) select the 'Trax' task
(g) select a user to play Trax with
(h) open the newly created task
(i) in another browser( tab), login as the invited player and open the task received from the key player
(j) have fun
*/
import Trax.UoD
import Trax.Tasks
import MultiUser.Tasks
import iTasks.Extensions.Admin.WorkflowAdmin, Text.HTML
Start :: *World -> *World
Start world
= startMultiUserTasks [ workflow "Trax" "Play Trax" play_trax ] [] world
Start world = doTasks
{WorkflowCollection
|name = "Trax"
,workflows = [ workflow "Host Trax" "Host a Trax game" play_trax ]
,loginMessage = Just loginMessage
,welcomeMessage = Nothing
,allowGuests = False
} world
where
loginMessage = DivTag []
[Text "This example implements the two-person tile game Trax.", BrTag []
,Text "To play the game do the following:"
,OlTag []
[LiTag [] [Text "Log in as a demo user for example 'alice' (password alice), 'bob' (password bob) or 'carol' (password carol)"]
,LiTag [] [Text "Choose New -> 'Host Trax' -> 'Create task'"]
,LiTag [] [Text "Open the task in the task list and invite another player"]
,LiTag [] [Text "The invited player can also log in and will find the game waiting for her in the task list."]
,LiTag [] [Text "Have fun"]
]
]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment